Stop the gossip. Do not tolerate them talking bad others. Show them a standard of yours, against gossip.
As they drive in the negative lane, drive in a positive lane. Circumvent their negatives with a strong negative.
Never laugh at their nasty jokes. Do not involve in desparaging humors either. Friends always seek for each others approval, your discouragement is an impactive discouragement.
Do not keep malice. Get a way or talk about it. Don't leave it to grow in your heart, you might lose your sanity in an attempt to revenge.
Show them how evictable they are. Show them that they are not the most important people in the world, not even among the best. Make it clear timely.
If this friend is the clingy type, deal with them here and do try to ignor their phone calls or even facebook messages.
Sometimes you just have to tell them in order to get it solved. Tell them how annoyed you are at the time they did it. if they're not sorry, ignore them.
There's no reason of being friends with those who are always mean to you. Fight for your independence!