'Imran b. Husain told of the Prophet asking his father, “How many gods do you worship to-day, Husain?” His father replied, “Seven, six in the earth and one in heaven.” He asked, “Which of them do you take account of regarding your hopes and your fears?” On receiving his reply that it was the one in heaven, he said, “If you were to accept Islam, Husain, I would teach you two phrases which would benefit you.” When Husain accepted Islam" he asked God’s messenger to teach him the two phrases he had promised him, and he told him to say, “O God, direct me in the right way and deliver me from the evil within myself.”
‘A’isha told of the Prophet looking at the moon and saying, “Seek refuge in God from the evil of this one, ‘A'isha, for this is the darkness when it overspreads.” 2
2. cf. Qur’an, cxiii, 3. The tradition is said to refer to the moon being eclipsed.
‘Amr b. Shu'aib, on his father’s authority, said that his grandfather reported God’s messenger as saying that when anyone was alarmed while asleep he should say, “I seek refuge in God's perfect words from His anger, His punishment, the evil of His servants, the evil suggestions of the devils and their presence,” for they will not injure him. 'Abdallah b. ‘Amr used to teach them to those of his children who had reached puberty and those who had not. He wrote them down on some material (1) and hung the writing on the child’s neck.
1. The word is sakh which usually means a document.
Abu Dawud and Tirmidhi transmitted it, this being Tirmidhi's wording.