Most Helpful Guy
First, try to take a moment and accept the problem for what it is: you are personalizing the actions of someone else.
Which means you are feeling a bit sensitive/lacking confidence in yourself and everything that is good about you.
Did he know you were into him?
If he knew you liked him, then went after your close friend, he is an insensitive person. If you are just associates with your friend, the guy is just doing what he does and it shouldn't bother you.
In any case, the fact that it is bothering you about you indicates you aren't taking of you properly. :) try to remind yourself how awesome you are.