عَنْ أَبِي مَسْعُودٍ الْبَدْرِيِّ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((إِنَّ الشَّمْسَ وَالْقَمَرَ لَا يَنْكَسِفَانِ لِمَوْتِ أَحَدٍ، قَالَ يَزِيدُ (أَحَدُ الرُّوَاةِ) وَلَا لِحَيَاتِهِ وَلَٰكِنَّهُمَا آيَتَانِ مِنْ آيَاتِ اللَّهِ تَعَالَى، فَإِذَا رَأَيْتُمُوهُمَا فَصَلُّوا))
It is narrated from Sayyiduna Abu Mas’ud Badri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: Surely, the sun and the moon do not lose their light due to anyone’s death or life; rather, they are two signs among the signs of Allah. Therefore, when you see them in this state, perform prayer.