Father of all mercies and giver of all comfort:
deal graciously, we pray, with those who mourn,
that, casting all their care on you,
they may know the consolation of your love;
through Jesus Christ our Lord.
Also found here: http://www.beliefnet.com/prayers/christian/death/prayer-for-those-who-mourn.aspx#hwckbYYCie2SB1v1.99
prayer for the dead in middle ages
prayers for the dead