The sun was eclipsed during the lifetime of the Prophet ﷺ. He came out to the place of prayer, said the takbir, and the people said the takbir with him. Then he recited aloud, prolonging the recitation, then bowed and prolonged the bowing. Then he raised his head and said, "Allah hears whoever praises Him." Then he stood and recited, prolonging the recitation, then bowed and prolonged the bowing. Then he raised his head, then prostrated. Then he stood and did the same in the second rakah.Then he said, "The sun and the moon are two of the signs of Allah . They do not eclipse for anyone's death or life. So when you see that happen, hasten to prayer."
حدثنا عبد الصمد حدثنا سليمان بن كثير قال حدثنا الزهري عن عروة
خسفت الشمس على عهد النبي ﷺ فأتى النبي ﷺ المصلى فكبر وكبر الناس ثم قرأ فجهر بالقراءة وأطال القيام ثم ركع فأطال الركوع ثم رفع رأسه فقال سمع الله لمن حمده ثم قام فقرأ فأطال القراءة ثم ركع فأطال الركوع ثم رفع رأسه ثم سجد ثم قام ففعل في الثانية مثل ذلك ثم قال إن الشمس والقمر آيتان من آيات الله عز وجل لا ينخسفان لموت أحد ولا لحياته فإذا فعلوا ذلك فافزعوا إلى الصلاة
Its isnad is sahih. Muslim narrated it 2/620 no. 901, Nasai 9/129 no. 1470, and Ibn Khuzayma 2/316 no. 1383, all in the Book of the Eclipse, and Abu Dawud 1/305 no. 1177 in the Book of Prayer, the eclipse prayer.