Sayyiduna Qabisah al-Hilali (may Allah be pleased with him) related that the sun was eclipsed in the time of the Messenger of Allah (peace and blessings be upon him), while he (peace and blessings be upon him) was in Madinah, until the stars became visible to the people. The Prophet (peace and blessings be upon him) stood and prayed two rak'ahs in which he (peace and blessings be upon him) lengthened the standing. When he had completed the prayer, he turned to the people and said: "When you see any of these signs (such as solar and lunar eclipses), it is only a warning from Allah, the Mighty and Majestic. So when you see them, pray like the most recent prayer you have prayed."
Hadith Referenceالمعجم الكبير للطبراني / باب القاف / 16047