On the day of a solar eclipse, Messenger of Allah ﷺ stood up (to offer the eclipse prayer). He recited Takbir, recited a long recitation (of Holy Verses), bowed a long bowing, and then he raised h is head saying. "Allah hears him who sends his praises to Him." Then he stayed standing, recited a long recitation again, but shorter than the former, bowed a long bowing, but shorter than the first, performed a long prostration and then performed the second rakʿa in the same way as he had done the first. By the time he had finished his prayer with Taslim, the solar eclipse had been over. Then he addressed the people referring to the solar and lunar eclipses saying, "These are two signs amongst the Signs of Allah, and they do not eclipse because of anyone's death or life. So, if you see them, hasten for the Prayer."
أَنَّ رَسُولَ اللَّهِ ﷺ يَوْمَ خَسَفَتِ الشَّمْسُ قَامَ فَكَبَّرَ وَقَرَأَ قِرَاءَةً طَوِيلَةً ثُمَّ رَكَعَ رُكُوعًا طَوِيلاً ثُمَّ رَفَعَ رَأْسَهُ فَقَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ وَقَامَ كَمَا هُوَ فَقَرَأَ قِرَاءَةً طَوِيلَةً وَهْىَ أَدْنَى مِنَ الْقِرَاءَةِ الأُولَى ثُمَّ رَكَعَ رُكُوعًا طَوِيلاً وَهْىَ أَدْنَى مِنَ الرَّكْعَةِ الأُولَى ثُمَّ سَجَدَ سُجُودًا طَوِيلاً ثُمَّ فَعَلَ فِي الرَّكْعَةِ الآخِرَةِ مِثْلَ ذَلِكَ ثُمَّ سَلَّمَ وَقَدْ تَجَلَّتِ الشَّمْسُ فَخَطَبَ النَّاسَ فَقَالَ فِي كُسُوفِ الشَّمْسِ وَالْقَمَرِ إِنَّهُمَا آيَتَانِ مِنْ آيَاتِ اللَّهِ لاَ يَخْسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ فَإِذَا رَأَيْتُمُوهُمَا فَافْزَعُوا إِلَى الصَّلاَةِ