CONSOLATION OF MOURNERS
Gemara
27b (R. Yochanan): Once the Avel nods his head, the consolers may not sit by him;
Everyone must stand for the Nasi, except for an Avel or a Choleh (sick person). One may say 'sit' to anyone except for an Avel or a Choleh.
28b (R. Yochanan): The consolers may not speak until the Avel begins;
First, "Acharei Chen Posach Iyov Es Pihu". Afterwards, "Va'Ya'an Elifaz..."
Question: What is the source that the Avel sits at the head?
Answer #1 (R. Avahu): "Evchar Darkam v'Eshev Rosh...ka'Asher Avelim Yenachem"
Question: Yenachem connotes consoling others (the consoler is at the head)!
Answer (Rav Nachman bar Yitzchak): It is written so we can read it 'Yinachem' (will be consoled).
Answer #2 (Mar Zutra): We learn from "V'Sar Mirzach Seruchim" - Mirzach (an Avel) become a Sar (head) over Seruchim (many people).
Bava Kama 38a (Ula): The consolation they give in Bavel is blasphemy! They say 'what can one do', which implies that one could do (differently than Hash-m did), he would!
Rishonim
Rif and Rosh (3:89): Once the Avel nods his head, the consolers may not sit by him.
Nimukei Yosef (DH Avel): The Avel may not give Shalom. Therefore, he bows like a Talmid to his Rebbi to show when the consolers should go. Some say that an Avel is normally heavy headed. If he shakes his head and lifts it, this shows that he has been consoled.
Rif: Everyone must stand for the Nasi, except for an Avel or a Choleh. One may say 'sit' to anyone except for an Avel or a Choleh, for it connotes 'Stay in your Aveilus (or sickness)'.
Nimukei Yosef (ibid.): When we stop in the middle of the funeral procession, if there are many Avelim or Cholim, we do not say 'Amodu' (stop) or 'Shevu', for it connotes 'Stay in your Aveilus (or sickness)'. Others say that if the Avel rises to honor someone, we do not tell him to sit. Rather, we say 'May Hash-m console you. Do not exert yourself.'
Tosfos (27b DH l'Chol): When Chachamim stand up, one must tell them to sit. When an Avel or Choleh stands, this is not necessary. Since they were not obligated to stand, they may sit without permission.
Rif and Rambam (Hilchos Evel 13:3) and Rosh (98): The consolers may sit only on the ground - "Va'Yeshvu Ito la'Aretz".
Source (Gra YD 387:2): The Ramban and Tur (387) also cite this Drashah from the Gemara, and they cite another Drashah from this verse obligating the Avel to sit on the ground. This was in the Gemara; the printers omitted it.
Nimukei Yosef (DH Ein): "Ito" teaches that they sit like the Avel does.
Rif and Rosh (99): The consolers may not speak until the Avel begins. It says "V'Ein Dover Elav...Acharei Chen Posach Iyov Es Pihu... Va'Ya'an Elifaz..." We learn that the Avel sits at the head from "Evchar Darkam va'Eshev Rosh...ka'Asher Avelim Yenachem".
Nimukei Yosef (DH Ein): Iyov used to counsel others and sit at the head, like an Avel. We rely on the tradition (to pronounce 'Yinachem').
Tosfos (Kesuvos 69b DH Omar Rav): Yenachem can be read Yinachem. The verse could have said "Menachem' (console), which cannot be read any other way.
Rambam (3): The Avel sits at the head. The consolers may not speak until the Avel begins. It says "V'Ein Dover Elav...Acharei Chen Posach Iyov Es Pihu...Va'Ya'an Elifaz..." Once the Avel nods his head, the consolers may not sit by him, lest they exert him too much.
Rambam (5): Everyone must stand for the Nasi, except for an Avel or a Choleh.
Rambam (ibid.) and Rosh (89): One may say 'sit' to anyone standing, except for an Avel or a Choleh, for it connotes 'Stay in your Aveilus (or sickness)'.
Poskim
Shulchan Aruch (YD 376:1): The consolers may not speak until the Avel begins.
Beis Yosef (DH Ein): The Ramban cites Rav Hai Gaon to say that this is why the Avelim begin by saying 'Baruch Dayan ha'Emes'.
Shulchan Aruch (ibid.): The Avel sits at the head. Once the Avel nods his head in a way that connotes that he exempts the consolers, they may not sit by him.
Rema: An Avel or a Choleh need not stand even for a Nasi.
Shevus Yakov (1:26, cited by R. Akiva Eiger and Birkei Yosef): The Levush says that he is exempt because he is distracted. This is difficult, for an Avel must fulfill other Mitzvos! Rather, he is exempt because his rising does not give honor. This is why one is exempt from rising in a bathhouse. However, if he wants to rise he may. This is clear from the Rambam (Evel 13:5). Also, Yakov rose for Yosef even though he was sick; Avelim and Cholim are equated. Likewise, on Tish'ah b'Av one may rise for his Rebbi, but he is not obligated.
Note: Birkei Yosef cites Shevus Yakov to say that one is obligated on Tish'ah b'Av. It should say 'one is permitted' - Shiyurei Berachah (1, in Sefer Birkei Yosef.)
Shiyurei Berachah (4): An Avel is obligated to stand for a Sefer Torah.
Shulchan Aruch (2): If Reuven rises to honor Shimon, Shimon tells him 'sit', unless Reuven is an Avel or a Choleh, for it connotes 'Stay in your Aveilus (or sickness)'.
Rema: One may not tell the Avel 'what can you do', for this implies that if it was possible to change what happened, he would. Rather, he accepts Hash-m's decree with love.
Source (Nimukei Yosef Bava Kama 19a DH Gidufa): One must accept Hash-m's decree with love - "Gam Es ha'Tov...(v'Es ha'Ra Lo Nekabel?!)" One is obligated to bless on the bad like on the good (Berachos 54a).
Rebuttal (Yam Shel Shlomo Bava Kama 4:10 DH midha'Rif): The Halachah does not follow this, for (after Bas Sheva's son died) David said "Ha'Uchal Lahashivo Od". This does not implying that if he could, he would. Rather, he explained that there is no point to further prayer and fasting for this.
Defense (Taz 1): Consolers who say 'what can you do' do not refer to Tefilah.
Shulchan Aruch (387:1): During the day an Avel does not sit even on an inverted bed, rather, on the ground. Also the consolers may sit only on the ground.
Maharshal (brought in Taz 1): The Avel must sit on the ground only when consolers are there. Then, also the consolers must sit on the ground, unless the Avel pardons his honor and tell them to sit on chairs. Perhaps consolers do not sit on the ground nowadays because we assume that the Avel pardons his honor.
Taz (1): The Maharshal means that at other times the Avel may stand or walk. Surely, he may not sit!