It is narrated from Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) taught a man to say when he lay down on his bed: 'Allahumma wajjahtu wajhi ilayk, wa alja'tu zahri ilayk, wa fawwadtu amri ilayk, wa aslamtu nafsi ilayk, rahbatan wa raghbatan ilayk, la malja'a wa la manja minka illa ilayk, amantu bi-kitabika alladhi anzalt, wa bi-nabiyyika alladhi arsalt' (O Allah, I have turned my face towards You, entrusted my back to Your protection, committed my affair to You and surrendered my soul to You, in longing for You and in fear of You; there is no refuge and no escape from You except to You. I believe in Your Book which You revealed and in Your Prophet whom You sent). Then if that man dies that very night, he will be forgiven.
No one narrated it from Amr bin Qays (may Allah have mercy on him) except Thawr bin Yazid (may Allah have mercy on him), and no one from Thawr (may Allah have mercy on him) except Yahya bin Hamzah (may Allah have mercy on him), and his son is alone in narrating it from him.
Hadith Referenceالمعجم الأوسط / باب الألف / 52
Hadith Takhrij«أخرجه البخاري فى «صحيحه» برقم: 247، 6311، 6313، 6315، 7488، ومسلم فى «صحيحه» برقم: 2710، 2711، وابن خزيمة فى «صحيحه» برقم: 216، وابن حبان فى «صحيحه» برقم: 5522، 5523، 5527، 5536، 5542، والنسائي فى «السنن الكبرى» برقم: 10519، 10520، 10521، 10522، 10525، 10526، 10523، 10527، 10528، 10541، 10540، 10542، 10543، 10544، 10547، 10546، 10545، 10548، 10549، 10553، 10550، 10552، 10551، 10554، 10555، وأبو داود فى «سننه» برقم: 5046، (4/471) [دون رقم في الترقيم المختار]، والترمذي فى «جامعه» برقم: 3394، 3399، 3574، والدارمي فى «مسنده» برقم: 2725، وابن ماجه فى «سننه» برقم: 3876، وأحمد فى «مسنده» برقم: 18764، 18809، 18850، 18858، 18886، 18887، 18902، 18916، 18930، 18950، 18953، 18954، 18955، 18971، 18959، 18980، 18986، 18996، والطيالسي فى «مسنده» برقم: 743، 744، 780، والحميدي فى «مسنده» برقم: 740، وأبو يعلى فى «مسنده» برقم: 1668، 1683، 1711، 1721، وعبد الرزاق فى «مصنفه» برقم: 19829، وابن أبي شيبة فى «مصنفه» برقم: 27051، 27055، 27057، 27063، 27068، 29906، 29907، 29908، 29913، 29923، والطحاوي فى «شرح مشكل الآثار» برقم: 1137، 1136، 1139، 1138، 1140، والترمذي فى «الشمائل» برقم: 254، والطبراني فى «الصغير» برقم: 3، والطبراني فى «الأوسط» برقم: 1248، 1494، 1636، 2827، 3429، 6051»