Berachos3: 1
מִי שֶׁמֵּתוֹ מֻטָּל לְפָנָיו — פָּטוּר מִקְּרִיאַת שְׁמַע, מִן הַתְּפִלָּה וּמִן הַתְּפִלִּין. נוֹשְׂאֵי הַמִּטָּה וְחִלּוּפֵיהֶן וְחִלּוּפֵי חִלּוּפֵיהֶן, אֶת שֶׁלִּפְנֵי הַמִּטָּה וְאֶת שֶׁלְּאַחַר הַמִּטָּה: אֶת שֶׁלַּמִּטָּה צֹרֶךְ בָּהֶן — פְּטוּרִין, וְאֶת שֶׁאֵין לַמִּטָּה צֹרֶךְ בָּהֶן — חַיָּבִין. אֵלּוּ וָאֵלּוּ פְּטוּרִין מִן הַתְּפִלָּה
One whose dead [relative] lies before him is exempt from the recitation of the Shema, from Prayer and from [donning] tefillin. The pallbearers, and those who replace them, and those who replace their replacements, those in front of the bier and those behind the bier: those needed [to carry] the bier are exempt [from reciting the Shema], and those not needed [to carry] the bier are obligated. Both these and these are exempt from Pray-er.