I have dealt with a similar situation. At first, I didn't realize what this person was doing, as I try to give people the benefit of the doubt, but over time, it became clear that this person was actively trying to undermine myself and another person in my cohort who they must have felt "threatened" by. At risk of identifying myself, I won't go into specifics, but it was some pretty crazy, underhanded stuff and I was similarly shocked, as I cannot fathom doing such things to others. Unfortunately, I don't really have a good solution for this kind of behavior... I think the biggest thing is knowing that a person has this tendency and being able to anticipate that they are going to actively try and screw you over, and adjust your conduct accordingly (i.e., distancing yourself from them so they cannot wreak havoc). In my case, I treated this person as a "frenemy" and was cordial publicly, but distanced myself and didn't work with them on a one-to-one basis, and if I did, I made sure that I was on top of their sneaky nonsense. Luckily, we were not in a lab together, otherwise it would've been a lot harder... I think there are more people in academia like this than we care to admit sometimes...