Many people worry, before going to comfort a mourner, "What should I say?" The answer is: very little. A person in pain needs to talk, and he needs someone to listen to him talk. He doesn't need you to say very much. Your job, in comforting the mourner, is to listen to the mourner, responding when necessary and appropriate. Always let the mourner take the lead in the conversation.
Our basic requirement is to make the mourner feel better. The idea is not that we should try to take his mind away from his pain. A mourner has to come to grips with his loss, to learn to accept it, and not ignore it. He has to pour out his feelings and express his sorrow. You can show your empathy and caring by listening to him. Even just entering and not speaking gives comfort, and honors the mourners.
Most of all, the mourner needs to know that he is not facing the world alone, that he has friends.
When is the best time to visit a mourner? One may visit and comfort a mourner at any time during the shivah. However, the first three days of the shivah, when the pain is greatest, it is best if only close friends and family visit. During the first three days, a mourner cannot truly be comforted, because the pain is still too fresh. However, if it is difficult for you to visit later, you are technically permitted to visit even during the first three days.
Following are Laws that we must follow when at the house of a mourner:
It is forbidden for a mourner to be joyful during the shivah.(9) This is no time for telling jokes or for being light-hearted.
A mourner is forbidden to say hello or goodbye; likewise we do not say hello or goodbye to a mourner. We do not say "shalom," or any other greeting.(10)
The visiting comforters may not begin speaking until the mourner has spoken to them first.(11)
Once the mourner has nodded his head in farewell (since he is forbidden to say "goodbye"), the comforter may no longer sit there, but must leave.(12) The reason for this is because overstaying your visit could cause the mourner discomfort.(13) Since these days nodding the head is not a standard method of communication, make sure you keep very attuned to the mourner's feelings so you will know when to leave.(14)
Before leaving a mourner you say, in any language you prefer, "Hamakom yinachem eschem b'soch sha'ar availay Tzion v'Yerushalayim." Which means: "May Hashem, Who is everywhere, comfort you amongst the other mourners of Zion and Jerusalem."(15) The mourners should answer "Amen."(16)