It's seldom easy to intrvene appropriately when there is hurtful so-called "banter" going on. But once or twice I've seen/heard someone say quietly, "Hey now. Don't you think you're going a bit over the line?" or something similar. Only thing I've ever said & done in a similar situation was, I thought things were extremely out of hand and said that I'd be going bc I wasn't comfortable with the way the evening was unfolding.. And left.