A rainbow doesn’t actually exist, so it doesn’t really have an end where you can find a pot of gold. Optically speaking, it is just a distorted “virtual image” of the sun. Each raindrop acts as a tiny, imperfect mirror. When the sun is right behind you its light passes through the raindrops in front of you, reflects off their rear surface and bounces back at you. The light is refracted or “bent” slightly as it passes from the air into the water; and again as it bounces back into the air again. The different wavelengths that combine to make daylight are “bent” by different amounts (42º for the red end of the spectrum, a shade less for the violet). Each raindrop acts as both prism (refraction) and mirror (reflection).