Translation:Shulchan Aruch/Orach Chaim/287

1. Comforting Mourners and Visiting the Sick on Shabbos: We may comfort mourners on Shabbat and we may visit the sick. We do not speak to them the same way we speak to them during the week. Rather, we say to them “It is Shabbos, when it is forbidden to cry out; healing will [surely] come soon, for His mercies are abundant; rest on Shabbos in tranquility". RAMA: There are those who say that we do not have to say 'His mercies are abundant' and such is the custom. (Rambam)