The sun was eclipsed during the time of the Messenger of Allah ﷺ. He would pray two rakahs, then make supplication, then pray two more rakahs, then make supplication, until the sun became clear again.He said, "Some people from the days of ignorance used to say, or claim, that when the sun or the moon is eclipsed, it is eclipsed only because of the death of one of the great ones among the people of the earth. But that is not so. Rather, they are two of Allah's creations, and when Allah manifests Himself to anything of His creation, it humbles itself before Him."
حدثنا عفان حدثنا عبد الوارث حدثنا أيوب فذكر حديثا قال وحدث عن أبي قلابة عن رجل
كسفت الشمس على عهد رسول الله ﷺ وكان يصلي ركعتين ثم يسأل ثم يصلي ركعتين ثم يسأل حتى انجلت الشمس قال فقال إن ناسا من أهل الجاهلية يقولون أو يزعمون أن الشمس والقمر إذا انكسف واحد منهما فإنما ينكسف لموت عظيم من عظماء أهل الأرض وإن ذاك ليس كذلك ولكنهما خلقان من خلق الله فإذا تجلى الله عز وجل لشيء من خلقه خشع له