When one receives or in conversation and a racist comment is made - politely ask them to repeat it, then say (again politely and pleasantly) "that's what I thought you said" - and move the conversation along on another topic.

Sometimes I think people don't actually hear what they are saying themselves. Give them an opportunity to listen to themselves without judgement - maybe they will actually hear what they themselves are saying.

After all, you can't fix stupid - and that's what racism is, stupidity