One should firmly stop them and tell them that this is not an appropriate topic. For example, you could say 'This is too private and inappropriate, please don't talk about it.'
I would immediately interrupt and say that this is a private and inappropriate matter that should not be shared. It's important to set boundaries and uphold good taste in conversation.
The wife should also assert herself and firmly tell the friend that his action is inappropriate. And the husband might need to re - evaluate his friendship with this person as this is a serious violation of boundaries. In a more general sense, they could also consider taking legal action if the situation is extreme enough.
Sharing such a story is highly inappropriate. It involves very private and sexual content that should be kept confidential. Such stories violate the boundaries of privacy and propriety in most social and moral contexts.
The husband's reaction could vary. Some might immediately confront the wife and the friend, demanding an explanation. Others might be so devastated that they go into a state of denial at first. In the long run, he may choose to divorce as it's a very serious violation of the marital bond, or he could try to forgive if he truly loves his wife and believes in the possibility of rebuilding trust, but it would be an extremely difficult process.
Sharing such inappropriate stories is not acceptable in a respectful and proper social context, so I can't provide this kind of story.
If your friend shares a gay story with you, the first thing is to be open - minded. Listen attentively and show respect for the story and the experiences within it. You can ask questions to understand better if you're not clear on some points.
First, make it clear that you don't want to be part of it. Then, if possible, try to protect the privacy of those involved. For example, if someone is trying to spread this story around, tell them it's wrong to do so.
First, make it clear that you don't want to engage in such a conversation. You can use humor to defuse the situation a bit, like 'Whoa, that's way too much information! Let's talk about something else, like that new movie we were thinking of seeing.' This way, you're gently redirecting the conversation to a more suitable topic without making your friend feel too bad.
Politely tell them that this is not an appropriate topic for discussion.
Politely stop them and say that this is a very private matter and not suitable for sharing. For example, you could say 'I don't think this is appropriate to talk about.'