The sun was eclipsed, so the Messenger of Allah ﷺ went out and prayed two rakahs, prolonging the recitation in them. Then the eclipse cleared, and he said, "The sun and the moon are two of Allah's signs, by which He instills fear in His servants. When you see that, pray as you would the most recent obligatory prayer you have offered."
حدثنا عبد الوهاب الثقفي حدثنا أيوب عن أبي قلابة
انكسفت الشمس فخرج رسول الله ﷺ فصلى ركعتين فأطال فيهما القراءة فانجلت فقال إن الشمس والقمر آيتان من آيات الله تبارك وتعالى يخوف بهما عباده فإذا رأيتم ذلك فصلوا كأحدث صلاة صليتموها من المكتوبة