When I was out of town for a few days, I saw an inverted rainbow. How does something like this arise?
An inverted rainbow hot zenith arch. The weather phenomenon is somewhere else in the sky than a normal rainbow, and is created in a different way.
Ice crystals break the light
You can see the zenith arch as the sunlight is broken by ice crystals in thin cirrus clouds high in the atmosphere. With this refraction, the light passes from one medium to the other, for example from air to ice. Because the speed of light is different in the two media, the light rays change direction.
The degree of refraction, however, depends on the wavelength of the light. The long wavelengths in the red part of the visible spectrum deflect the least, and the short ones in the violet part the most.
White light is split
In this way the white sunlight is split into all its colors. The color shift provides the rainbow effect in the zenith arch - and also the effect in the rainbow itself, where the light breaks into water droplets.