Abdullah bin Abbas reported,

Rain fell upon the people during the time of the Prophet ﷺ, so the Prophet ﷺ said, "Some of the people have risen this morning grateful, and others ungrateful. Some said, 'This is the mercy of Allah,' while others said, 'The prediction of such-and-such star has proven true.'"Then this verse was revealed, "So I swear by the setting of the stars" until it reached "and you make your provision that you deny." [Waqiah 56:75–82]

Muslim 234

Sahih

و حدثني عباس بن عبد العظيم العنبري حدثنا النضر بن محمد حدثنا عكرمة وهو ابن عمار حدثنا أبو زميل قال حدثني

ابن عباس قال

مطر الناس على عهد النبي ﷺ فقال النبي ﷺ أصبح من الناس شاكر ومنهم كافر قالوا هذه رحمة الله وقال بعضهم لقد صدق نوء كذا وكذا قال فنزلت هذه الآية {فلا أقسم بمواقع النجوم} حتى بلغ {وتجعلون رزقكم أنكم تكذبون}

مسلم 234صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Faith
Chapter
Clarification of the disbelief of one who says "We were given rain by the stars"
Numbering
Darussalam 234
Muslim 234