Solar and lunar eclipse prayers
When a solar or lunar eclipse is seen, prayer, supplication, takbir and charity are prescribed. On the day of a solar eclipse, the Prophet ﷺ explained that the sun and moon are signs of God and that an eclipse is not caused by a person’s death or life. The solar eclipse prayer is an emphasized Sunnah according to the majority. For a lunar eclipse, Shafiis and Hanbalis emphasize the prayer; the well-known Maliki view is that people pray individually as in ordinary voluntary prayer. Its time lasts until the eclipse clears.
Aishah, may God be pleased with her, described the Prophet’s ﷺ solar eclipse prayer. He stood and recited at length, bowed, rose and recited a shorter passage, bowed a second time, then rose and prostrated twice. He did likewise in the second rakah and concluded with salam. Thus the two rakahs together contain four bowings and four prostrations. This is the majority’s form for the solar eclipse; Hanafis describe one bowing in each rakah. Jurists differ in detail on congregational prayer for a lunar eclipse.
If the eclipse has cleared before a person prays, the time for this act of worship has ended. Someone who finishes praying while the eclipse continues occupies themselves with supplication, remembrance and charity.
Ibn Rushd, Bidayat al-Mujtahid, chapter on the eclipse prayer: its form during solar and lunar eclipses.