Finding the right words

I am currently struggling with what to do about friends in online communities who post stuff that I find really objectionable. Things like outrageously sexist, racist or homophobic comments - or calling for the return of capital punishment. Things that come out of the blue, that reveal something about the person that you struggle with, but that you had no idea about before. 

If I was into drawing graphs for this sort of thing there would be one axis with degrees of friendship and another of with degrees of unacceptability and where the two crossed would determine what I do about the issue. With a low level of friendship and and a high degree of unacceptability it is easy - you just "unfriend" the person. But with real friends it is not so easy. It is a bit like when a sweet old lady, maybe a relative of a friend, comes out with an outrageously racist comment. You know it is partly her upbringing, you know at one level she doesn't really mean it, and you know that to make it an issue would really cause her embarrassment and hurt her - but you also know that to say nothing is wrong too.

I understand that online I should comment, explain my discomfort, and engage in a conversation about our differences but, just as in real life, this can be a real challenge. The potential for kicking off a flame war at worst or of hurting feelings at best is very high. Given the inability to use body language or facial expressions to modify your message you have to be so conscious of your choice of language and tone.

I kind of know the answer to this but still struggle. How do you deal with it?