Jabir said there was an eclipse of the sun in the time of God’s Messenger on the day his son Ibrahim died. He led the people in prayer, performing six bowings and four prostrations.
There was an eclipse of the sun, and the Prophet got up in trepidation fearing that the last hour fiad come. He then went to the mosque and prayed, standing, bowing and prostrating himself longer than I had ever seen him do. He then said, “These signs which God sends do not come on account of anyone’s death or on account of his birth, but God produces dread in His servants by means of them. So when you see anything of that nature, apply yourselves to making mention of Him, supplication of Him and asking pardon of Him."
وَعَن ابْن عَبَّاس قَالَ: صلى الله عَلَيْهِ وَسلم حِين كسفت الشَّمْس ثَمَان رَكْعَات فِي أَربع سَجدَات
وَعَن عَليّ مثل ذَلِك. رَوَاهُ مُسلم
Ibn ‘Abbas said that when an eclipse of the sun took place, God’s Messenger prayed performing eight bowings and four prostrations. There is a similar tradition from 'Ali.
Narrated ‘A'isha told a tradition similar to that of Ibn ‘Abbas and said:
Then he prostrated himself for a long time, then departed and the sun had become clear. He preached to the people, and after praising and extolling God he said, “The sun and the moon are two of God’s signs; they are not eclipsed on account of anyone’s death or on account of anyone's birth, so when you see that supplicate God, declare His greatness, pray and give alms." He then said, “O people of Muhammad, I swear by God that no one is more indignant than God when His servant or handmaiden commits fornication. O people of Muhammad, I swear by God that if you knew what I know you would laugh little and weep much."