Abdullah bin Masud reported,

When the Quraysh defied the Prophet ﷺ, he prayed against them, asking Allah to afflict them with years of famine like the years of Yusuf. So a drought and severe hardship struck them until they ate bones. A man would look up at the sky and see something like smoke between him and it because of the intensity of his hunger. Then Allah Almighty revealed, "So watch for the Day when the sky will bring a visible smoke covering the people. This is a painful torment" [Dukhan 44:10–11].The Messenger of Allah ﷺ was approached, and it was said, "Messenger of Allah, pray to Allah for rain on behalf of Mudar, for they have perished."He replied, "For Mudar? You are indeed bold."Then he prayed for rain, and they were given rain. So the verse was revealed, "Indeed, you will return". When ease returned to them, they reverted to their former state once prosperity reached them, so Allah عز وجل revealed, "The Day We will strike with the greatest assault, indeed, We will take retribution". He said, this refers to the day of Badr.

Azami 2971

Sahih

عن ابن مسعود قال

إن قريشا لما استعصوا على النبي ﷺ دعا عليهم بسنين كسني يوسف، فأصابهم قحط وجهد حتى أكلوا العظام، فجعل الرجل ينظر إلى السماء فيرى ما بينه وبينها كهيئة الدخان من الجهد، فأنزل الله تعالى: {فارتقب يوم تأتي السماء بدخان مبين يغشى الناس هذا عذاب أليم} [سورة الدخان: ١٠-١١] قال: فأتي رسول الله ﷺ فقيل: يا رسول الله! استسق الله لمضر، فإنها قد هلكت. قال: لمضر؟ إنك لجريء. فاستسقى فسقوا. فنزلت: {إنكم عائدون} فلما أصابتهم الرفاهية عادوا إلى حالهم حين أصابتهم الرفاهية، فأنزل الله عز وجل: {يوم نبطش البطشة الكبرى إنا منتقمون} قال: يعني يوم بدر.

الأعظمي 2971صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Prayer for rain
Section
When the polytheists seek intercession from the Muslims during drought
Numbering
Jami al-Kamil 2971 (2nd edition)
Azami 2971