How do I deal with a guy Who is selectively nice? Advice please?

I have a guy friend who is selectively nice to people. This drives me crazy because that is one of my biggest pet peeves. Anyway he basically chooses who he wants to be nice to and is very mean to others for no reason. I have a hard time just stop being his friend because he chooses to be nice to me and we've had some fun jokes together and stuff and we have the same friend group. I get really mad at him though because he is really high and mighty and mean to my best guy friend. He has no reason to be that way though! I don't know what to do now.
How do I deal with a guy Who is selectively nice? Advice please?
Post Opinion