Narrated Abu Qatada:
The Prophet said, "A good dream is from Allah, and a bad or evil dream is from Satan; so if anyone of you has a bad dream of which he gets afraid, he should spit on his left side and should seek Refuge with Allah from its evil, for then it will not harm him."