Authentic Supplication Number 154.

The Messenger of Allah  used to teach them that if they went out to graveyards the spokesman among them should say: 'As-salamu `alaykum 'ahl 'addiyari minal mu'mineena wal muslimeena wa'inna 'insha'a 'allahu bikum lahiqoona, nas'alul-laha lana wa lakum 'al`afiyata (172).

Footnotes.
(172) Peace be upon you, dwellers of this province, of the Faithful and Submitting; and we Allah willing will be joining you: I ask Allah, for you and for us, wellness.

Reporters.
Reported by Muslim, and is #123 in The Authentic of Good Sayings.