Volume 2, Book 18, Number 150:
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.”
Volume 2, Book 18, Number 151:
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.”
Volume 2, Book 18, Number 152:
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.”
Volume 2, Book 18, Number 153:
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.”
Volume 2, Book 18, Number 154:
Narrated ‘Aisha :
In the life-time of Allah’s Apostle (p.b.u.h) the sun eclipsed, so he led the people in prayer, and stood up and performed a long Qiyam, then bowed for a long while. He stood up again and performed a long Qiyam but this time the period of standing was shorter than the first. He bowed again for a long time but shorter than the first one, then he prostrated and prolonged the prostration. He did the same in the second Raka as he did in the first and then finished the prayer; by then the sun (eclipse) had cleared. He delivered the Khutba (sermon) and after praising and glorifying Allah he said, “The sun and the moon are two signs against the signs of Allah; they do not eclipse on the death or life of anyone. So when you see the eclipse, remember Allah and say Takbir, pray and give Sadaqa.” The Prophet then said, “O followers of Muhammad! By Allah! There is none who has more ghaira (self-respect) than Allah as He has forbidden that His slaves, male or female commit adultery (illegal sexual intercourse). O followers of Muhammad! By Allah! If you knew that which I know you would laugh little and weep much.