I've been fortunate enough in my life that I haven't had any real close encounters with sad deaths ... only the old and/or sick have left my life. And I don't know if that's the reason, but I really never know what to say to the bereaved. I usually stick with Sorry and then something about prayers for their family. Which, while appropriate, seems inadequate.
And now the new etiquette of Facebook. The past few months have been hard on the loved ones of my friends -- most recently losing a six-month-old child and a father-in-law. Do you express sympathy online? Do you write on the Wall? Send a personal message? Say nothing, knowing that whatever you say online will be even lamer than it would be in person? Does it make a difference if your FB friend is some distance away and you don't see them in person?
Sometimes I say something. Sometimes I don't. Always I pray and send good thoughts. Hoping that's enough. Or as much as it can be.