From Aishah, may Allaah be pleased with her, that the Prophet صلى الله عليه وسلم said, “Indeed the devil comes to you and says, ‘Who created you?’ He says, ‘Allaah.’ He says, ‘So who created Allaah?’ So when one of you finds that [i.e., such whisperings], let him read, ‘I believe in Allaah and His Messengers,’ for verily that will leave him.” [Silsilah 116 Hasan]
From Abu Hurairah, may Allaah be pleased with him, who said, “The Prophet of Allaah صلى الله عليه وسلم said, “The devil comes to one of you and says, ‘Who created such and such? Who created such and such? Who created such and such?’ Until he says, ‘Who created your Lord?’ When he reaches that [level], then let one seek refuge with Allaah and refrain from such thoughts.” [Bukhaari and Muslim, Silsilah no. 117]
“The people are about to question each other, such that one of them will say, ‘(This saying of yours that) Allaah created the creation (is well-known), so who created Allaah, the Mighty and Majestic?’ When they say that, then say, ‘Allaah is One. Allaah is the Self-Sufficient Master. He begets not, nor was He begotten. And there is none co-equal or comparable to Him.’ Then let him spit [dry-spit] to his left three times and seek refuge from the Devil.” [Silsilah 118 Hasan] [Trans. note: the additions in parentheses () were taken from Awn al-Ma’bood.]
Shaikh al-Albaani said, “These authentic hadiths show that it is incumbent upon the one to whom the Devil has whispered by saying, ‘Who created Allaah?’ to turn away from arguing with him and instead answer him with what has been reported in the aforementioned hadiths.
And the summary is that he should say:
آمَنْتُ بِاللهِ وَرُسُلِهِ
اللهُ أَحَدٌ اللهُ الصَّمَدُ
لَمْ يَلِدْ وَلَمْ يُولَدْ
وَلَمْ يَكُنْ لَهُ كُفُوًا أَحَدٌ
Āmantu billāhi wa rusulihi̱.
Allāhu Aḥad. Allāhus-Ṣamad.
Lam yalid, wa lam yūlad.
Wa lam yakullahū kufuwan aḥad.
‘I believe in Allaah and His Messengers.
Allaah is One. Allaah is the Self-Sufficient Master.
He begets not, nor was He begotten.
And there is none co-equal or comparable unto Him.’
Then spit to his left three times and then seek refuge with Allaah from the Devil and finally refrain from drifting away with the whisperings.
And I believe that whoever does so, out of obedience to Allaah and His Messenger, being sincere in it, then the whisperings will certainly leave him. And his devil will be vanquished, due to his saying صلى الله عليه وسلم, “… for verily that will leave him.”
And this noble, prophetic instruction is more beneficial and more final in terminating the whisperings than logical argumentation in this issue. For indeed argumentation rarely benefits in issues such as it.
And what a pity it is that most people are ignorant of this precious, prophetic instruction!
So take heed, O Muslims!
And become acquainted with the Sunnah of your Prophet, and act upon it–for verily, in it is your cure and your honour.”
Silsilah, vol. 1, pp., 233-236.