If what your friend is saying is affecting your other relationships or even your job, then you need to confront them politely and point out that they are doing real damage to you and so as a friend they must cease and desist. If they don’t stop then remove then from your group of friends.
If it is doing s doing no real harm other than hurting your feelings, then I would say suck it up unless a perfect opportunity comes up for you to politely ask them to stop because your feelings are being hurt. Depending on the response you might keep them as a friend or simply gradually withdraw.
And if what they are saying is really bad, totally untrue, and ends up on the front page, sue them!