It's fine to feel sorry for a friend or colleague when they go through a rough patch, but openly expressing sympathy in their presence will probably leave them feeling even more downtrodden than they were before they met you. Sympathy has a way of making a situation feel worse than it really is: it reinforces the bad with the underlying message being that the friend or colleague in question lacks the aptitude to prevail. If they could rectify their situation they wouldn't need sympathy, so weakness is being insinuated when you "feel sorry" for them. This is why feeling pity for a person makes them appear and feel more hopeless.
Empathy is less patronizing but no less understanding than sympathy. But at the same time it's also more empowering and less melodramatic. When enough people "feel sorry" for a person experiencing a rough patch, that person begins to believe the underlying message that they are weak. The thought will take root in their mind: My situation must be really bad if so many people feel sorry for me. However, if you merely empathize by saying something like "I know what you're going through" or "It must be tough" once, you're showing consideration without any disempowering element. Empathy says you feel or at least understand what someone is experiencing, but you fall short of patronizing and belittlement. Empathy turns to sympathy when you say "sorry" or "shame" repeatedly and start wearing a pitiful frown.
Sympathy is warranted in situations like the loss of a loved one, but in times of lesser misfortune it's better to empathize than sympathize. As cold as it may seem, there's little point to feeling sorry for someone -- pity is mostly emotional and does little to rectify a situation. Solutions and suggestions are more productive than pity. Showing understanding then swiftly proceeding to help find the way forward is the best way to help someone experiencing a downturn.