When seeing lightning and thunder, there are two blessings to be said (see below):

Blessing A:

בָּרוּךְ אַתָּה ה' אֱלֹקֵינוּ מֶלֶךְ הָעוֹלָם, עוֹשֶׂה מַעֲשֵׂה בְרֵאשִׁית

Bah-rookh ah-tah ah-doh-noy, eh-loh-hay-noo meh-lehkh hah-oh-lahm oh-say mah-ah-say beh-ray-shit

Blessed are You, L‑rd our G‑d, King of the universe, Who performs the work of creation

Blessing B:

בָּרוּךְ אַתָּה ה' אֱלֹקֵינוּ מֶלֶךְ הָעוֹלָם, שֶׁכֹּחוֹ וּגְבוּרָתוֹ מָלֵא עוֹלָם

Bah-rookh ah-tah ah-doh-noy, eh-loh-hay-noo meh-lehkh hah-oh-lahm sheh-koh-kho oo-geh-voo-rah-toh mah-lay oh-lahm

Blessed are You, G‑d our L‑rd, King of the universe Whose power and might fill the world

In the event that you experienced the two phenomena one after another, you say two blessings, one for the lightning and the other for the thunder. The custom is to first say Blessing A for the lightning, which you experience first, and then Blessing B for the thunder. Why? Because Blessing B talks about G‑d’s might, something we all feel in our gut when we hear the crashes of thunder.

Once you have said these blessings, you do not say them again for the duration of that storm. Practically speaking, as long as the clouds have not dispersed you need not say another blessing for lightning and thunder, even if they are repeated again and again.

If, for whatever reason, you experience just one of the phenomena, it is still customary to say Blessing A for the lightning and Blessing B for the thunder. If the lightning and thunder occur at the same time, just say one of the above blessings.

Read the laws of the blessings on thunder and lightning here.