Display of the dispersal of radiation from a celestial object into its constituent wavelengths. Such a display allows one to observe the wavelengths present in the radiation and their relative intensities.
The spectrum is directly connected with the color of the star.
The stars with an M spectrum are red, those with a G spectrum are yellow (like the Sun) and those with an O spectrum are white.
Spectrum are O, B, A, F, G, K, M, R, N, S that can be remembered by this magic sentence:
Oh, be a fine girl, kiss me right now sweet.