Sunan an-Nasa'i, Volume 2, Book 16, Hadith 1487 (DarusSalam)

It was narrated that Qabisah bin Mukhariq Al-Hilali said: "There was an eclipse of the sun and at the time we were with the Messenger of Allah in Al-Madinah. He rushed out dragging his garment and prayed two rak'ahs, which he made lengthy. The end of his prayer coincided with the end of the eclipse. He praised and glorified Allah (SWT), then he said: 'The sun and the moon are two of the signs of Allah (SWT), and they do not become eclipsed for the death or birth of anyone. If you see anything of that, then pray like the last obligatory prayer you did before that.'"

وَأَخْبَرَنَا إِبْرَاهِيمُ بْنُ يَعْقُوبَ، قَالَ حَدَّثَنَا عَمْرُو بْنُ عَاصِمٍ، أَنَّ جَدَّهُ، عُبَيْدَ اللَّهِ بْنَ الْوَازِعِ حَدَّثَهُ قَالَ حَدَّثَنَا أَيُّوبُ السَّخْتِيَانِيُّ، عَنْ أَبِي قِلاَبَةَ، عَنْ قَبِيصَةَ بْنِ مُخَارِقٍ الْهِلاَلِيِّ، قَالَ كَسَفَتِ الشَّمْسُ وَنَحْنُ إِذْ ذَاكَ مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم بِالْمَدِينَةِ فَخَرَجَ فَزِعًا يَجُرُّ ثَوْبَهُ فَصَلَّى رَكْعَتَيْنِ أَطَالَهُمَا فَوَافَقَ انْصِرَافُهُ انْجِلاَءَ الشَّمْسِ فَحَمِدَ اللَّهَ وَأَثْنَى عَلَيْهِ ثُمَّ قَالَ ‏ "‏ إِنَّ الشَّمْسَ وَالْقَمَرَ آيَتَانِ مِنْ آيَاتِ اللَّهِ وَإِنَّهُمَا لاَ يَنْكَسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ فَإِذَا رَأَيْتُمْ مِنْ ذَلِكَ شَيْئًا فَصَلُّوا كَأَحْدَثِ صَلاَةٍ مَكْتُوبَةٍ صَلَّيْتُمُوهَا ‏" ‏ ‏.‏

sunnah.com