When something in the sky frightens people
His son had just died and the sun eclipsed. People connected the two.
إِنَّ الشَّمْسَ وَالْقَمَرَ آيَتَانِ مِنْ آيَاتِ اللَّهِ، لاَ يَنْخَسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ، فَإِذَا رَأَيْتُمْ ذَلِكَ فَادْعُوا اللَّهَ وَكَبِّرُوا، وَصَلُّوا وَتَصَدَّقُوا
The sun and the moon are two signs among the signs of Allah. They are not eclipsed for anyone's death or life. So when you see that, pray and call upon Allah.
He refused the flattering explanation on the very day it would have honoured his own son, and told them to pray instead.
The full narration
Narrated `Aisha:In the lifetime of Allah's Messenger (ﷺ) the sun eclipsed, so he led the people in prayer, and stood up and performed a long Qiyam, then bowed for a long while. He stood up again and performed a long Qiyam but this time the period of standing was shorter than the first. He bowed again for a long time but shorter than the first one, then he prostrated and prolonged the prostration. He did the same in the second rak`a as he did in the first and then finished the prayer; by then the sun (eclipse) had cleared. He delivered the Khutba (sermon) and after praising and glorifying Allah he said, "The sun and the moon are two signs amongst the signs of Allah; they do not eclipse on the death or life of anyone. So when you see the eclipse, remember Allah and say Takbir, pray and give Sadaqa." The Prophet then said, "O followers of Muhammad! By Allah! There is none who has more ghaira (self-respect) than Allah as He has forbidden that His slaves, male or female commit adultery (illegal sexual intercourse). O followers of Muhammad! By Allah! If you knew that which I know you would laugh little and weep much
Source
Ṣaḥīḥ al-Bukhārī · 1044
- Agreed upon as authentic (al-Bukhārī / Muslim)