Can always add the rest of the sentence after the "I'm sorry." ... to hear of your loss. A plain old "I'm sorry" just sounds like a trite meaningless phrase to spurt out without thought. If you can use the same phrase to respond to a dead grandmother or a dropped beer, then you can probably do better.