A solar eclipse occurred during the time of the Messenger of Allah ﷺ, so he rose in alarm, fearing that the Hour had come, until he reached the mosque. He stood and prayed, prolonging his standing, bowing, and prostration more than I had ever seen him do in any prayer. Then he said, "These signs that Allah sends do not occur for the death or life of anyone, but Allah sends them to instill fear in His servants. So when you see any of them, hasten to His remembrance, supplication, and seeking His forgiveness."
خسفت الشمس في زمان رسول الله ﷺ فقام فزعا يخشى أن تكون الساعة، حتى أتى المسجد، فقام يصلي بأطول قيام وركوع وسجود، ما رأيته يفعله في صلاة قط، ثم قال: إن هذه الآيات التي يرسلها الله، لا تكون لموت أحد ولا لحياته، ولكن الله عز وجل يرسلها يخوف بها عباده، فإذا رأيتم منها شيئا فافزعوا إلى ذكره ودعائه واستغفاره.
Bukhari narrated it in the Book of Eclipses (1059), and Muslim in the Book of Eclipses (912), both from Muhammad bin Ala, who said, "Abu Usama narrated to us, from Burayd bin Abdullah, from Abu Burda, from Abu Musa," and the wording of both is identical.Kusuf means darkening. It is said that a person's face "kasafa" when it changes color. Khusuf means diminishing. Some linguists said that kusuf refers to the sun and khusuf to the moon, but this distinction is not found in the Quran or the sunnah, so one term is used in place of the other.Kusuf and khusuf are among the signs of Allah, occurring to instill fear in His servants so that they return to Allah . The Prophet ﷺ therefore commanded prayer when they occur, until they clear.Scholars differed regarding the ruling on the eclipse prayer. Some of the early scholars said it is obligatory, based on the Prophet's ﷺ action and his command in the hadith of Abu Masud Badri, "When you see them, stand and pray." This is what Abu Hanifa held, as Zayn bin Munir reported from him, and as some Hanafi authors likewise reported. This is what the Hafiz said in Fath al-Bari (527/2). However, in Hanafi books such as Badai Sanai (80/1), Durr Mukhtar (788/1), and others, it is stated that it is a confirmed sunnah, and this is the view of the majority of scholars, the Malikis, the Shafiis, and the Hanbalis. See Mughni Muhtaj (316/1), Muhadhdhab (122/1), and Mughni (2/426).It is prayed in the congregational masjid, in a group, attended by both men and women.