It's hard, and even harder if the friend is particularly close to you.
You should always try to make one last effort with them. Meet up with them and try and air your problems in a non-confrontational manner. As strange as it sounds, some people really don't realise the effect their words can have.
If your friend does not respond to your thoughts, or continues to behave in the same manner, then you may just have to say goodbye to them.