Narrated Abdullah bin Amr: When the sun eclipsed in the lifetime of Allah’s Messenger, peace be upon him, a loud announcement was made (saying): As Salat-u-Jami’a (prayer to be offered in congregation).
[2: 155- O.B. Sahih Al-Bukhari)
Narrated Abu Bakr: We were with Allah’s Messenger, peace be upon him, when the sun eclipsed. Allah’s Messenger, peace be upon him, stood up dragging his cloak till he entered the mosque. He led us in a two-Rak’ah prayer till the sun (eclipse) had cleared. Then the Prophet, peace be upon him, said, “The sun and the moon do not eclipse because of someone’s death. So whenever you see these (eclipses) offer the Salat and invoke (Allah) till the eclipse has cleared.”
In another quotation the Prophet, peace be upon him, said, “But with (eclipses), Allah frightens His slaves.” The Hadith of eclipses is repeated many times. In another quotation from Mughira bin Shu’ba it is narrated that the sun eclipsed in the lifetime of Allah’s Messenger, peace be upon him, 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 Messenger, peace be upon him, said, “The sun and the moon do not eclipse because of the death or life (i.e. birth) of someone. When you see the eclipse, offer Salat and invoke Allah.”
[2: 150, 153 & 158- O.B. Sahih Al-Bukhari)