In the Shafi’i school, the lunar eclipse (salat al-khusuf) is the fourth most prioritised optional prayer to be performed (the salat al-kusuf being more prioritised, the Eid al-Fitr prayer even more so, and the Eid al-Adha prayer being the most prioritised optional prayer).
The minimum is to pray simply two raka’as of prayer, with the intention of fulfilling the sunna of this particular prayer, which is occasioned by a partial or a full eclipse. Better than the two basic two raka’as would be to make ruku’ **twice** in each raka’ (instead of the usual one), and to read al-fatiha in the two standings/qiyams in each raka’). Better than this still would involve more lengthy recitations in the qiyām as well as more litanies read in the ruku’ – a detailed explanation is reproduced below from Umdat al-Salik.
It is sunna in the school to take a ghusl prior to the prayer.
It is better to pray it in a group, following which the imam performs a khutba. It fulfils the recommendation to pray on one’s own, though in such a situation, no khutba would be performed.
There is no adhan.
– The optimal way to pray the salat al-khusuf is that after reciting the Opening Supplication (Isiftah, de: f8.13), the
Ta’awwudh (f8.16), and the Fatiha, one:
(a) recite al-Baqara (Koran 2) for the first Koran recital;
(b) recite Al ‘Imran (Koran 3) after the second time one recites the Fatiha (A: in the first rak’a);
(A: then, in the second rak’a)
(c) recite al-Nisa (Koran 4) for the third recital;
(d) and recite al-Ma’ida (Koran 5) for the fourth recital.
Or one may recite comparable amounts of the Koran in place of the above suras.
One bows and says “Subhana Rabbiya al-`Adhim’ (“How far above any limitation is my Lord Most
Great”) after the first of the four Koran recitals for a period equal to reciting one hundred verses of alBaqara (N: about 20 minutes); after the second recital for the length of eighty of its verses; after the
third for the length of seventy verses; and after the fourth for the length of fifty verses.
The other parts of the eclipse prayer are the same as other prayers.
After praying, it is recommended that the imam give two sermons like those of the Friday prayer.