Upon seeing a rainbow, one should recite the Bracha Zocher Habris Vneeman Babriso Vkayam Bmaamaro. The Mechaber writes that one should not stare at it.
In addition, the Mishna Berura writes that if someone sees a rainbow, he should not tell other, rather he should privately recite the proper Bracha. The reason for this is that a rainbow is a sign that Hashem in not satisfied with the world, and if not for the covenant that was made with Noach, the world would be in danger of destruction. By telling others, we are publicizing this bad omen.
There is no limit to the amount of times this Bracha can be recited.
The Mechaber teaches us the Halachos of Birchas Hachamah here as well. Birchas Hachamah takes place once every 28 years when the sun is in the exact location it was in at the time the world was created. This Mitzva was done this past Pesach.

