A rainbow is an optical phenomenon that appears as a circular arc in the sky, though typically observed as a semicircle from the ground. The formation involves sunlight refracting through raindrops, splitting into a spectrum of colors, with the angles at which colors are viewed varying between 40 and 42 degrees relative to the sun. The visibility of a rainbow also depends on the observer's position and the sun's location relative to them.