i'm a bit of an amoralist so take this with a grain of salt.
i would ride it out. get what you want from her (here's a hint: it's not her friendship!) for as long as you can while at the same time actively seeking a replacement. when you find someone new, get rid of the old.
i'm guessing your friend is a little on the rebellious/punk side and girls tend to like that, but rebels only care about themselves; which is where you come in. you're the nice guy that talks to her and does stuff for her so she uses you for comfort and stability, but she's more attracted to your friend and will ditch you for whenever your buddy gives her a second of attention because she knows you'll always be there.
be a man, turn these lemons into lemonade. they don't care about hurting you so you shouldn't care about taking advantage of the situation. you know what's going on here, so don't feel bad about taking what you deserve.
this is what a self-respecting man would do, and women like men that respect themselves.