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

It was narrated from An-Nu'man bin Bashir that : The Prophet said: "If there is an eclipse of the sun or the moon, pray like the last obligatory prayer you did before that."

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

sunnah.com