The rainbow effect can be observed whenever there are water drops in the air and sunlight shining from behind the observer at a low altitude or angle. A rainbow does not actually exist at a location in the sky, but rather is an optical phenomenon whose apparent position depends on the observer's location.
In Greek mythology, the rainbow was considered to be a path made by a messenger (Iris) between Earth and Heaven. In Chinese mythology, the rainbow was a slit in the sky sealed by Goddess Nüwa using stones of five different colours. The Irish leprechaun's secret hiding place for his crock of gold is usually said to be at the end of the rainbow (which is impossible to reach). In the Hebrew Bible, the rainbow is a symbol of the covenant between God and man, and God's promise to Noah that He would never again flood the entire Earth.
Information source: Wikipedia