Abdullah bin Abbas reported,

Rain fell upon the people during the time of the Prophet ﷺ. The Prophet ﷺ said, "Some of the people have risen this morning grateful, while others have risen ungrateful. They said, 'This is the mercy of Allah,' while others said, 'The prediction of such-and-such a 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 it" [Waqiah 56:75–82].

Azami 169

Sahih

عن ابن عباس قال

مطر الناس على عهد النبي ﷺ، فقال النبي ﷺ: أصبح من الناس شاكر، ومنهم كافر، هذه رحمة الله، وقال بعضهم: لقد صدق نوء كذا وكذا. فنزلت هذه الآية {فلا أقسم بمواقع النجوم} حتى بلغ: {وتجعلون رزقكم أنكم تكذبون} [الواقعة: ٧٥- ٨٢].

الأعظمي 169صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Explaining the use of the term "disbelief" for one who says, "We were given rain by the stars"
Numbering
Jami al-Kamil 169 (2nd edition)
Azami 169