Ibn ‘Umar told that when God’s messenger went to his bed at night he said, “Praise be to God who has given me sufficiency, has guarded me, given me food and drink, been most gracious to me, and given to me most lavishly. Praise be to God in every circumstance. O God, Lord and King of everything, God of everything, I seek refuge in Thee from hell.”
Abul Azhar al-Aimari told that when God’s messenger went to his bed at night he said, “In the name of God. I have laid down my side for God. O God, forgive me my sin, drive away my devil, free me from my responsibility, and place me in the highest assembly.”
Buraida said that Khalid b. al-Walid complained to God’s messenger that he was afflicted by sleeplessness at night, and God’s Prophet told him to say when he went to his bed, “O God, Lord of the seven heavens and what they overshadow, Lord of the earths and what they carry, Lord of the devils and what they lead astray, be a Protector to me from the evil of Thy entire creation lest any of them do evil or act wrongfully to me. Strong is Thy protection and glorious is Thy praise. There is no god other than Thee. There is no god but Thee.”
Tirmidhi transmitted it, saying this is a tradition whose isnad is not strong, and the traditions of al-Hakam b. Zuhair, the transmitter, are abandoned by some traditionists.
Abu Huraira told that when the Prophet went to his bed he used to say, “O God, Lord of the heavens, Lord of the earth, Lord of everything, who splittest the grain and the kernel, who hast sent down the Torah, the Injil and the Qur’an, I seek refuge in Thee from the evil of every evil agent whose forelock Thou seizest. Thou art the First and there is nothing before Thee; Thou art the Last and there is nothing after Thee; Thou art the Outward and there is nothing above Thee; Thou art the Inward and there is nothing below Thee. Pay the debt for me and grant me riches instead of poverty.”
Abu Dawud, Tirmidhi and Ibn Majah transmitted it. Muslim also transmitted it with a slight difference.