Kitaab-ul-Kusoof [Book of Eclipses] starts today..
Volume 2, Book 18, Number 849:
Narrated Abu Bakra:
We were with Allah’s Apostle when the sun eclipsed. Allah’s Apostle stood up dragging his cloak till he entered the Mosque. He led us in a two-Rakat prayer till the sun (eclipse) had cleared. Then the Prophet (p.b.u.h) said, “The sun and the moon do not eclipse because of someone’s death. So whenever you see these eclipses pray and invoke (Allah) till the eclipse is over.”
Narrated Abu Masud:
The Prophet said, “The sun and the moon do not eclipse because of the death of someone from the people but they are two signs amongst the signs of Allah. When you see them stand up and pray.”
Narrated Ibn ‘Umar:
The Prophet said, “The sun and the moon do not eclipse because of the death or life (i.e. birth) of someone but they are two signs amongst the signs of Allah. When you see them offer the prayer.”
Narrated Al-Mughira bin Shu’ba:
“The sun eclipsed in the life-time of Allah’s Apostle on the day when (his son) Ibrahim died. So the people said that the sun had eclipsed because of the death of Ibrahim. Allah’s Apostle said, “The sun and the moon do not eclipse because of the death or life (i.e. birth) of some-one. When you see the eclipse pray and invoke Allah.”
Allaah says (interpretation of the meaning):
“It is He Who made the sun a shining thing and the moon as a light and measured out for it stages that you might know the number of years and the reckoning. Allaah did not create this but in truth. He explains the Ayaat in detail for people who have knowledge.” [Yoonus 10:5]
“And from among His Signs are the night and the day, and the sun and the moon. Prostrate yourselves not to the sun” nor to the moon, but prostrate yourselves to Allaah Who created them, if you (really) worship Him” (Fussilat 41:37)
Salaat al-Kusoof (Prayer of the Eclipses) is Sunnah mu’akkadah (a confirmed Sunnah) according to the consensus of the scholars. The daleel (evidence) for this is the Sunnah reported from the Messenger of Allaah SAWS (peace and blessings of Allaah be upon him)
Eclipses are signs from Allaah by means of which Allaah makes His slaves afraid. Allaah says (interpretation of the meaning): “And We sent not the signs except to warn, and to make them afraid (of destruction)” [al-Israa’ 17:39]
Solar and lunar eclipses are two of the signs of Allaah with which He scares His slaves and reminds them of some of the things which will happen on the Day of Resurrection, when the sun will be wound round and will lose its light and be overthrown and the stars will fall (cf. al-Takweer 81:1), and the sight will be dazed, the moon will be eclipsed and the sun and moon will be joined together (by going into one another, or folded up, or deprived of their light) (al-Qiyaamah 75:8-9). This is why Muslims should be alarmed by eclipses.
During the Jaahiliyyah, people used to believe that eclipses happened to mark the birth or death of a great person, but the Messenger of Allaah SAWS (peace and blessings of Allaah be upon him) declared this belief to be false and explained the divine wisdom behind the occurrence of eclipses.
More on eclipses and Salat-ul-Kusoof here.