What do you say on facebook to friends or family that have lost a loved one? Most people type prayers or sending prayers. I usually post you and your family are in my thoughts.
Gift certificates to a take-out in their area. There are so many things to take care of in those first few days.
And the shock, especially if unexpected may send a person into near debilitating depression.
Maybe offering to pay for house cleaning for awhile.
Visit even though they may be horrible company.
I have a lot of facebook friends that I went to high school with who I haven't seen in years and so I will say, "I'm so sorry for your loss, my thoughts are with you and your family" If they are someone I'm closer to, like family or a close friend, I will add a comment that speaks of the departed's good qualities.
I have an old childhood friend going through chemo. I tell her I am thinking about her. Sorry to hear if family loss.
Its not easy to find words of encouragement on such circumstances (regardless of the media or face to face, etc). However, I have learned over the years how love ones appreciate kind words in those difficult times. Probably the worst thing one can say its to say nothing...