When someone opens up and tells you something painful that has occurred in their life, I'll give you a surefire perfect answer. Simply say: "That sucks."
(If you absolutely can't use that word, then find an appropriate alternative.)
Don't try to fix it. Don't try to pat it down. Don't try to tie it up with a nice little bow. They've already
tried that. They simply want you to grieve with them.
(I promise you that's what they really want!)