Reference : Hisn al-Muslim 21

بِسمِ الله وَالصّلاةُ وَالسّلامُ عَلى رَسولِ الله،
اللّهُـمَّ إِنّـي أَسْأَلُكَ مِـنْ فَضْـلِك،
اللّهُـمَّ اعصِمْنـي مِنَ الشَّيْـطانِ الرَّجـيم
Bismillāhi waṣṣalātu wassalāmu 'alā Rasūlillāhi, 
Allāhumma 'innī 'as'aluka min faḍlika,
Allāhumma`ṣimnī min ash-shaytānir-rajīm.

In the Name of Allah, and peace and blessings be upon the Messenger of Allah.
O Allah, I ask for Your favor,
O Allah, protect me from Satan the outcast.

Reference:
ibid.

Chapter: Upon leaving the mosque