The sin in question is called ‘Detraction’.
Detraction is defined (in the Catholic Encyclopedia) as:
“… The unjust damaging of another’s good name by the revelation of some fault or crime of which that other is really guilty or at any rate is seriously believed to be guilty by the defamer.”
Longer description at:
http://www.newadvent.org/cathen/04757a.htm
My advice to you:
With your buddy who is out of line: If possible, tell him privately and gently that you feel his conduct is out of line, and why. Suggest an alternative (more virtuous) mode of conduct he could be engaging in (e.g. being respectful and charitable about his ex girlfriend, both in front of her and behind her back). Ideally, persuade him to repent, apologize to her, and mean it (and if applicable and possible, to try to restore her good name to the people he’s “talked trash” to). Additionally, refuse to listen to his trash talk yourself. You can respect his ex girlfriend (and respect your friend) by stopping these conversations when your buddy tries to start them. Explain to him why you don’t want to hear it, don’t think it’s good for him (or for anyone) for him to be saying such things, and hold firm (while letting him know you’ll still listen to his feelings – just not to him trash talking about others. There’s a difference).
With anybody else in the entire world: Avoid the ‘hot topic.’ This is definitely gossip and nobody’s business but the couple’s, and however inelegantly they’re going about this themselves, you do not need to get involved. Publicizing the faults of either party would indeed be detraction on your part (unless there is a grave reason why someone needs to know the information; in that case my advice would be to also inform your ‘buddy’ of who you have told, and what you told that person about him. If you feel uncomfortable telling your buddy that, you should feel uncomfortable telling someone else the thing you plan to tell them).
Learning how to refuse to gossip can actually be a great life skill, because just like gossip spreads –
refusing to gossip spreads. When we ask someone for a juicy tidbit and they have the virtue to decline to share it, we feel a healthy shame that we asked in the first place, and admiration for the person who chose not to participate in gossip. If they do it well, they can become a model we imitate next time we’re asked to gossip (and refuse to by using the same basic words, etc).
(It’s also a healthy habit to learn to stop someone when they start gossiping to you in the first place, without you even asking. To be able to say – “Oh, actually, you know what, I think I’d rather not know anything more about that. I’m sure if [Joanna] wants to talk to me about that subject, she will – but unless she chooses to share it, I don’t think it’s my place to know. Thanks.” (or whatever fits the situation).)