Anas told that when God’s messenger went to his bed he said, “Praise be to God who has fed us, given us drink, satisfied us and given us refuge. Many there are who have no one to provide sufficiency for them, or give them refuge.”
Al-Bara’ b. ‘Azib said that when God’s messenger went to bed he lay on his right side and then said, “O God, I have handed over my soul to Thee, turned my face to Thee, entrusted my affairs to Thee, and committed my back to Thee out of desire for and fear of Thee. There is no refuge and no place of safety from Thee except by having recourse to Thee. I believe in Thy Book which Thou hast sent down and in Thy Prophet whom Thou hast sent.” God’s messenger said that if anyone repeated these words and died that night, he would die in the true religion. In a version he reported God’s messenger as telling a man to perform the ablution for prayer when he went to bed, lie down on his right side, and say, “O God, I have handed over my soul to Thee . . . Thou hast sent.” He added, “If you die during the night you will die in the true religion, and if you live till the morning you will obtain good.”
Narrated ‘Ali said that Fatima went to the Prophet to complain of the effect of the grinding-stone on her hand, as she had heard that he had acquired some slaves, but did not find him, so she mentioned the matter to ‘A'isha. When he came ‘A'isha informed him. ‘Ali said:
He visited us when we had gone to bed, and when we were about to get up he told us to stay where we were. He then came and sat down between her and me, and I felt the coldness of his foot on my belly. He then said, “Let me guide you to something better than what you have asked. When you go to bed, say ‘Glory be to God’ thirty-three times, ‘Praise be to God’ thirty-three times, and ‘God is most great’ thirty-four times. That will be better for you than a servant.”
Abu Huraira reported God’s messenger as saying that when any of them went to bed he should dust his bedding with the inner extremity of his lower garment, for he does not know what has come on to it since he left it. He should then say, “In Thy name, my Lord, I lay down my side and in Thee I raise it up. If Thou keepest my soul have mercy on it, but if Thou lettest it go guard it with that with which Thou guardest Thy upright servants.” A version says that he should then lie down on his right side and say, “In Thy name...”
(Bukhari and Muslim). A version says he should dust it three times with the border of his garment, and has “If Thou keepest my soul grant it pardon.”