Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates: I was with the Prophet (peace and blessings be upon him) on the night when a group of jinn was turned towards him. One of the jinn came towards the Prophet (peace and blessings be upon him) carrying a flame of fire, so Sayyiduna Jibril (peace be upon him) said: "O Sayyiduna Muhammad (peace and blessings be upon him), shall I not teach you words which, when you recite them, his flame will be extinguished and he will fall on his nostrils? Recite:
'A'udhu bi-wajhillahil-karim, wa kalimatihit-tammat allati la yujawizuhunna barrun wa la fajir, min sharri ma yanzilu min as-sama'i wa ma ya'ruju fiha, wa min sharri ma dhara'a wa bara'a fil-ardi wa ma yakhruju minha, wa min sharri fitan al-layli wan-nahar, wa min sharri tawariq al-layli wan-nahar, illa tariqan yatruqu bi-khayr, ya Rahman' (I seek refuge in the Countenance of Allah, the Most Generous, and in His perfect words, which no righteous or wicked person can go beyond, from the evil of whatever descends from the sky and whatever ascends to it, from the evil of whatever He has made and spread in the earth and whatever comes out of the earth, from the evil of the trials of the night and the day, and from the evil of those who come by night and by day, except one who comes bringing good, O Most Merciful!)"
Al-Tabarani recorded it in al-Mu'jam al-Saghir, and its chain contains a narrator whom I do not know.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأذكار / 17070
Hadith Gradingمحدثین:إسنادہ ضعیف
Hadith Takhrij«اخرجه أبو يعلى فى المسند (6844) اخرجه احمد فى المسند (419/3) ، أخرجه المعجم الأوسط للطبراني برقم: 43، وأخرجه السنن الكبرى للنسائي برقم: 11018»