During the lifetime of Messenger of Allah ﷺ I was shooting some of my arrows in Medina, when the sun eclipsed. I threw (the arrows) and said: By Allah, I must see how the Messenger of Allah ﷺ acts in solar eclipse. So I came to him and he was standing in prayer, raising his hands, glorifying Him, praising Him, acknowledging His Oneness, declaring His greatness, and supplicating Him, till the sun cleared. When the eclipse was over, he recited two surahs and prayed two rak'ahs.
عَنْ عَبْدِ الرَّحْمَنِ بْنِ سَمُرَةَ وَكَانَ مِنْ أَصْحَابِ رَسُولِ اللَّهِ ﷺ قَالَ كُنْتُ أَرْتَمِي بِأَسْهُمٍ لِي بِالْمَدِينَةِ فِي حَيَاةِ رَسُولِ اللَّهِ ﷺ إِذْ كَسَفَتِ الشَّمْسُ فَنَبَذْتُهَا فَقُلْتُ وَاللَّهِ لأَنْظُرَنَّ إِلَى مَا حَدَثَ لِرَسُولِ اللَّهِ ﷺ فِي كُسُوفِ الشَّمْسِ قَالَ فَأَتَيْتُهُ وَهُوَ قَائِمٌ فِي الصَّلاَةِ رَافِعٌ يَدَيْهِ فَجَعَلَ يُسَبِّحُ وَيَحْمَدُ وَيُهَلِّلُ وَيُكَبِّرُ وَيَدْعُو حَتَّى حُسِرَ عَنْهَا قَالَ فَلَمَّا حُسِرَ عَنْهَا قَرَأَ سُورَتَيْنِ وَصَلَّى رَكْعَتَيْنِ