Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates that in the time of the Messenger of Allah (peace and blessings be upon him) the people were given rain, and he (peace and blessings be upon him) said: "Today some people have entered the morning giving thanks and some disbelieving." The thankful ones said: "Allah Almighty has sent down this mercy of His." The deniers said: "Such-and-such star's reaching such-and-such a place has proven true, and the rain came because of such-and-such." And this verse was revealed: "So I swear by the setting places of the stars" [Surah al-Waqi'ah: 75] up to verse 82: "And you make your thanks (for His provision) that you deny it" [Surah al-Waqi'ah: 82].
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الاستسقاء / 6452