This happened quite recently to a friend and colleague of mine.
Another colleague made an off-hand 'joke' about a friend (an academic) potentially behaving inappropriately with his students. This was said in front of my friend's students (over 20) and within hearing range of his students, as my friend heard them laughing soon after the 'joke' was said (his own students apparently had shocked looks on their faces).
The situation was that he was setting up an experiment demonstration that required the lights turned off and curtains drawn (physics - lasers). Understandably, my friend was very angry, hurt and terribly embarrassed and could not bare to even look at his colleague who 'triumphantly went back to his own class' soon after.
Just a point I want to make here, the reason I am saying 'joke' in inverted commas, is because this kind of infantile rubbish can and does cause unwarranted mud to stick - and is potentially a lot more damaging for male teachers/lecturers. Also, it is a lame, disgusting, low-brow attempt at humour. (I have been a butt of a joke like that myself a few years ago and it inadvertently caused quite a bit of trouble, despite being 100% innocent and proven so).
There is no question of his innocence of any wrong doing, and being the true professional, he redirected his students back to the demonstration and completed the lesson.
He is the kind of person that does not like to make waves and does not like to make a fuss.
Lecturer X about to start his class requiring the lights to be off and curtains drawn for an experiment. Lecturer Y comes in unannounced and made the 'joke' about X potentially doing something inappropriate with the students in the darkness. This was in front of both X's and Y's students.
Lecturer Y went back to his class.
Lecturer X was justifiably insulted, but continued his lesson.
What course of action should he (Lecturer X) do? Particularly to protect himself from any potential future trouble regarding allegations etc from this 'joke'? (Which as I said, can occur).