When the sun is eclipsed, total or partial, then the Prophet ﷺ is reported to have performed Salātul Kusūf (solar eclipse prayer).
The Prophet ﷺ said:
“Verily, the sun and the moon are two of the signs of Allah and they do not eclipse on account of the death or birth of anybody. So whenever you see this, pray and invoke (Allah) until it is over."
How it is performed according to the Maliki school:
It is Sunnah Muakkada to perform Salatul Kusuf whenever there is a solar eclipse. The imam goes to the mosque and begins to lead the people in prayer without either an Adhan or an Iqama. It is recommended that it be performed in congregation, but it can also be performed at home, by oneself. The complete method to pray the solar eclipse prayer is as follows:
1.Make an intention to pray this sunnah prayer and make the opening takbir.
2.Recite (inaudibly) the Fatihah and a long surah of the Quran i.e. Surah al-Baqarah or its like.
3.Say ‘Allahu Akbar’ and go into ruku. Stay in ruku for a considerable period of time.
4.Say ‘Sami’ Allahu li-man Hamida’ and stand back up.
5.Recite the Fatiha, again, followed by another long surah of the Quran that is not as long as the previous one i.e. Surah Aali ‘Imran or its like.
6.Say ‘Allah Akbar’ and go into Ruku, less prolonged than the first.
7.Say ‘Sami’ Allahu li-man Hamida’, followed by ‘Rabbana wa laka l-Hamd’.
8.Then make two prolonged prostrations (Sajdatain).
9.Say ‘Allahu Akbar’ and stand back up.
10.Repeat steps (2) through (8), however, not as prolonged as the first; reciting Surah an-Nisa (or its like) in the third standing and Surah al-Ma’idah (or its like) in the fourth.
10.Say ‘Allahu Akbar’ and sit back up.
11.Finally, say the tashahhud and then the salam
According to the Shafi’is and some Hanbalis, the imam then gives a sermon (Khutbah). However, according to the Malikis, there is no Khutbah, however, its is preferable for to the Imam to take the opportunity to admonish his congregation.
Sources: Risalah Ibn Abi Zayd, Muqaddimat al-Hadramiyyah, al-‘Umda fi ‘l-Fiqh