Bereishit 9:9-15 Behold, I am making a covenant with you and with your offspring after you. And with every living creature that is with you, with the birds, the animals, and all the beasts of the earth with you, all who departed from the ark, including every living creature on earth. I will keep my covenant with you, that never again will all flesh be cut off by flood waters, never again will flood waters destroy the earth. Elokim said, This is the sign of the covenant that I pledge between Myself and you, and between every living creature that is with you, for the generations of all time. I have set my [rain] bow in the clouds, and it shall be a sign of the covenant between Myself and the earth. At a time when I bring clouds over the earth, the [rain] bow will be seen in the clouds. I shall remember My covenant that is between Myself and you, and between every living soul in all flesh, that never again will flood waters destroy all flesh.
G-d promised Noach that He would never again cause a flood. He now said to Noach, "I have already promised you this. But now I will give you a sign to put your mind at ease, so you will not be concerned. I will produce this sign when the Attribute of Justice denounces the world and argues that it should be destroyed once again, because people are wicked. The world will then begin to be covered with dark clouds, and the skies will turn black. Then, suddenly, the rainbow will appear. The attribute of Justice will then remember G-d's oath never again to cause a universal flood, and this Attribute will remain still. (Rashi)
This sign of the rainbow is not one that is visible on a daily basis whenever there are clouds in the sky as the wording of the Torah might suggest. The rainbow is also not visible on every rainy day. However, in a generation which is guilty of sins it appears in order to remind people of G-d's commitment. When a rainbow is seen, it is a sign that people are wicked, and deserve to be wiped out by another flood.
When one sees a rainbow, he should say the following blessing:
Blessed are You, O G-d our L-rd, King of the Universe, Who recalls the covenant, Who is faithful in His promise, and Who keeps His word.
[MeAm Lo'ez, Rabbi Bachya, Rashi]