Or you can try humor.

Gail Stern, an educator and a co-founder of Catharsis Productions, which gives sexual violence prevention training on college campuses and in the military, said that one deft approach might be to assume that the speaker is being outrageous on purpose, and to respond with something like this: “I love satire. It’s so weird that people believe that for real and it’s so cool you called that out.”

She calls that tactic “verbal aikido,” after the Japanese martial art whose practitioners defend themselves by redirecting an opponent’s attack.

An essential component of bystander intervention training is to get participants to imagine their own responses to scenarios. The goal is to get people to arm themselves with approaches that feel natural and innate, rather than outfitting them with model scripts. “If you have a plan in your head, then you can use it,” Dr. Potter said.

Psychologists who study the effects of such confrontation divide offensive behavior into two loose categories. One includes strangers acting out — a mother who slaps a toddler, a boy who punches his girlfriend — and bystanders, when they react, tend to do so viscerally and quickly. The other category includes offensive jokes or references among people who know one another, like friends or co-workers. In those cases, there are more gray areas, as well as personality factors to consider and often a relationship at stake. Objections, if they come, often take a little longer than bystander intervention does.

Deborah Cameron, a professor of language and communication at the University of Oxford, said that sexual banter often takes place among men who are friends, and that “the function of it is to promote bonding.”

Men may feel that if they challenge conversation they find tasteless, or simply don’t join in, “they’re spoiling the mood at a minimum and possibly putting their relationship to the group at risk,” she said. And sometimes they worry that “it will raise doubts about their masculinity or heterosexuality,” or that they will become targets of bullying, said Ms. Cameron, author of “The Myth of Mars and Venus: Do Men and Women Really Speak Different Languages?”