حَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، حَدَّثَنَا اللَّيْثُ بْنُ سَعْدٍ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ أَبِي سَلَمَةَ بْنِ عَبْدِ الرَّحْمَنِ بْنِ عَوْفٍ، عَنْ أَبِي قَتَادَةَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ ‏"‏ الرُّؤْيَا مِنَ اللَّهِ وَالْحُلْمُ مِنَ الشَّيْطَانِ فَإِنْ رَأَى أَحَدُكُمْ شَيْئًا يَكْرَهُهُ فَلْيَبْصُقْ عَنْ يَسَارِهِ ثَلاَثًا وَلْيَسْتَعِذْ بِاللَّهِ مِنَ الشَّيْطَانِ الرَّجِيمِ ثَلاَثًا وَلْيَتَحَوَّلْ عَنْ جَنْبِهِ الَّذِي كَانَ عَلَيْهِ ‏"‏ ‏.‏

It wasnarrated from Abu Qatadah that the Messenger of Allah (PBUH)said: “(Good) dreams come from Allah and (bad) dreams come from Satan,soif anyone of you sees something that he dislikes, let him spitdrylyto his left three times, and seek refuge with Allah from theaccursedSatan three times, and turn over onto his other side.” Translation Not Available

Book Ref: Sunan Ibn Majah Book 35 Hadith 3909
Web Ref:  Sunan Ibn Majah Vol 5 Book 35 Hadith 3909