Especially if you're married to them.
I think people want their suffering to be understood. All that's necessary is to let them know you identify with their problem. Just validate their complaint.
For example, saying "oh man! that sucks!" might be all that's needed. Or, "I can't believe he said that!" Or, "you can't be expected to read their mind!" etc.
You'll know you're effective if such comments start to relieve your conversation partner. If you're wrong and problem solving is actually called for, people will explicitly ask you for solutions-- especially if it's a conversation at work, as in the OP.
Once I realized it, I tried to observe everything I could. He used a lot of those techniques. Another useful one is, "That must have felt X ". Again, validating feelings.
Please note: telling someone that they shouldn't worry about something is pretty much the polar opposite of this, and should be avoided by anyone hoping to maintain a friendship with someone with feelings.
empathy > sympathy
This is one of the most important things about conversations I've ever learned. When someone comes to you with a problem, you need to detect if that person wants 1) your help with problem-solving, or 2) commiseration.
#1 tends to be a calm, analytical conversation, while #2 can be emotionally motivated.
When someone is looking for commiseration but you offer problem solving, you might actually add to their frustration by your lack of compassion for their situation.
If they're looking for problem solving but you commiserate, you might actually add to their frustration as they wonder why you're doing so little to help them.
Identification is the first step to being an effective conversation partner.