Berakhot 3:1: One whose dead lies before him, he is exempt from reciting the Shema, from saying Shemoneh Esrei and from wearing tefillin. The pall bearers and their replacements and the replacements of the replacements, regardless of whether they are in the front or in the back of the casket: those that are needed to carry the casket are exempt, and those that are not needed to carry the casket are obligated [to recite Shema]. These and those are exempt from reciting Shemoneh Esrei.