When white light passes through a prism, it is refracted, causing the different wavelengths of light to spread out and form a spectrum. The order of colors, known as the visible spectrum, begins with red, which has the longest wavelength, followed by orange, yellow, green, blue, indigo, and finally violet, which has the shortest wavelength. This sequence is often remembered by the acronym ROYGBIV, illustrating how light is separated into its constituent colors as it passes through the prism.