Shaykh-ul-Islâm Ibn Taymiyyah (rahimahullâh, d. 728) wrote in “Kitâb-ul-Îmân”:
The believer is put to trial by the whisperings of the Devil and disbelieving thoughts that makes him feel bad/distress. The companions used to say: “Oh Messenger of Allâh! one of us feels something of such a nature that he would rather fall down from the heaven than to utter it.” He (sallâ Allâhu ‘alayhi wa sallam): “That is true faith” (Ahmad 2/397 and Muslim 1/83)
This means that these whispers and thoughts one feels, while one hates them and repels them from the heart, is part of true faith. This can be likened to the warrior who fights his enemy until he overpowers him. This is the greatest type of Jihâd and a faith that is as pure as pure milk. And the reason as to why it is pure, is that one hates and fights the devilish thoughts.
All creatures are subjected to these thoughts and whisperings. There are those humans that answer them and they then become disbelievers or hypocrites. And there are those whom have fallen so deeply into sins and desires, that they are first affected by these thoughts when they start to seek the religion. So the person either becomes a believer or a hypocrite. Thus, the humans often tend to get these whispers when they perform the prayer. The Devil will most often come when the servant wants to turn to his Lord and come closer to Him and have contact with Him. That is why the praying ones get thoughts that the non-praying ones do not.
(Obs: Not entire text included).
Author: Shaykh-ul-Islâm Ahmad bin Taymiyyah (d. 728)
Source: Kitâb-ul-Îmân, pp. 221-222
aFatwadotcom (the site is down)