Thankfully we don't have to wait for sunshine and showers to study a spectrum. Although raindrops and glass prisms are easy ways to produce a spectrum, they are not the only way.
Modern scientific instruments (including the spectrometer I work with) use something called a diffraction grating. The spectrum is produced by having lots of fine lines or scratches on a surface.
Have you ever seen a diffraction grating? Sure you have - every time you pick up a CD! The tracks on the CD act like the scratches on a diffraction grating and produce a great spectrum.