"You have to realize that nothing you can say will help their loss."
I agree with John Doe's words above, having been widowed twice at young ages, nothing on earth touches the pain. Both times I was in such shock, which most people are at that time,... that words from friends just went over my head.
It would be sometime later, when I could reflect and really appreciate the kindness offered.
For me, just having people acknowledge the fact that it happened and not being afraid to bring it up (as tho the person never existed), helped on some level.
We all mean well when we try to express our feelings to another, but death is one of those things that only time will heal.
I tell people in those situations that I understand, that I am very sorry they are experiencing this, and it will get better in time even tho it doesn't feel like it.