It is hard to know what to say when someone else is having a really bad time of it. There isn't a good formula to know what exactly to do and how to present yourself because the person in dire need is both unique in and of themselves and also in a unique situation for them. As as example, if I was very sick I wouldn't want my friends and family coming by feeding me platitudes about how I will get well and everything will be fine. If the prognosis is crap then I don't want to spend my last days in irrational denial; joke with me, play a game with me, or have fun making jokes at the expense of the Pope but don't feed me garbage we all know isn't true. Of course there are lots of people (most people, I would suggest) who really do want people to come by and offer kind words that have no basis in fact. There are lots of folks who want expressions of faith more than anything in that circumstance.
I found an interesting article that talks about this in an attempt to tell people what to do. It suggests placing the patient in the centre of a diagram and placing all of the other people who know them on circles surrounding the centre. Parents, children, spouses, etc. would be on the first circle, close friends second circle, out to colleagues on say the fifth circle. The article then suggests that the way to approach these things is for anyone to be able to say anything at all to someone in a more distant circle but to always be 100% reassuring and calm to those in a circle closer to the centre. It specifically states that the patient in the centre can say or do anything to anyone.
I find all of that pretty silly. Sure, people should be more considerate of someone who is suffering. Their normal defenses and strength aren't available to them. The idea of a numerical ranking system that specifically denotes how people should behave strikes me as a bit loony though. Things are more complicated than that because sometimes people near the centre of a crisis are really strong and quite capable of helping those further out and sometimes people who aren't necessarily emotionally close to a person can be struck heavily by their situation. And then there are people like me who would feel betrayed if everybody fed me full of platitudes and ran off to talk to somebody else about their real feelings.
There are no obvious, simple rules we can follow when negotiating a complex situation like a person in need and their entire group of friends and family. Certainly it would be a good idea to tread lightly and say little if you really don't know the person in particular but relationships and situations are far too complex to be summed up by a simple ranking system. Think about what impact your statements will have on the people in front of you; if they will make things worse then don't say them. If you don't know find somebody who does know and ask. I think this is far better described by the nonspecific 'don't be a jerk' than anything else.