This seems to make sense – there's that word "rain" in "rainbow" after all. And with good reason. For a rainbow to be formed, there need to be water droplets in the air. Then, light has to shine through those droplets at just the right angle. If this happens – voilà! A rainbow!
But water droplets can be in the air for many other reasons. When it's misty outside or when there's overspray from, say, a waterfall or waves crashing against rocks; in foggy weather; around a fountain or even when it's dewy out. No matter what the source of the water droplets in the air, though, remember that the sun has to be at the proper angle – no higher than about 42 degrees of altitude – or the rainbow will be below the horizon and you most likely won't see it. If everything is in place, you still have to have the sunlight at your back in order to see the rainbow [sources: Edens, Rao].