First of all, does she answer him? If yes, then that sh#t needs to stop. NOW. Tell her to stop texting him back and if it does not stop she is OUT. Stand up for yourself, you are not a wimp, you have values and opinions and you deserve respect. Would she like it if some really hot girl sent you messages all the time and you responded? I don't think so.
Ask your "friend" why he is doing it and tell him you don't like it. He invites himself to events? WTF? I mean WTF? Your "friend" knows better than that, what a jerk.
"You are a reflection of your friends (and lovers)"