Ayesha reported,

The sun was eclipsed during the lifetime of the Messenger of Allah ﷺ. The Messenger of Allah ﷺ went out to the mosque, stood, and said the takbir, while the people lined up in rows behind him. The Messenger of Allah ﷺ then recited a lengthy recitation, said the takbir, and bowed for a long bowing. Then he raised his head and said, "Allah hears whoever praises Him. Our Lord, to You belongs all praise."He then stood and recited another lengthy recitation, though shorter than the first, said the takbir, and bowed for a long bowing, though shorter than the first. Then he said, "Allah hears whoever praises Him. Our Lord, to You belongs all praise."He did the same in the second rakah, completing four bowings and four prostrations. The sun had cleared before he finished.Then he stood and addressed the people. He praised Allah as He deserves to be praised, then said, "The sun and the moon are two of the signs of Allah. They do not eclipse for the death or life of anyone. So when you see them eclipse, hasten to prayer."

Ibn Majah 1263

Sahih

حدثنا أحمد بن عمرو بن السرح المصري حدثنا عبد الله بن وهب أخبرني يونس عن ابن شهاب أخبرني عروة بن الزبير

عن عائشة قالت

كسفت الشمس في حياة رسول الله ﷺ فخرج رسول الله ﷺ إلى المسجد فقام فكبر فصف الناس وراءه فقرأ رسول الله ﷺ قراءة طويلة ثم كبر فركع ركوعا طويلا ثم رفع رأسه فقال سمع الله لمن حمده ربنا ولك الحمد ثم قام فقرأ قراءة طويلة هي أدنى من القراءة الأولى ثم كبر فركع ركوعا طويلا هو أدنى من الركوع الأول ثم قال سمع الله لمن حمده ربنا ولك الحمد ثم فعل في الركعة الأخرى مثل ذلك فاستكمل أربع ركعات وأربع سجدات وانجلت الشمس قبل أن ينصرف ثم قام فخطب الناس فأثنى على الله بما هو أهله ثم قال إن الشمس والقمر آيتان من آيات الله لا ينكسفان لموت أحد ولا لحياته فإذا رأيتموهما فافزعوا إلى الصلاة

ابن ماجه 1263صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Eclipse prayer
Numbering
Darussalam 1263
Ibn Majah 1263