how are the colors in a spectrum from an atom different from those in a rainbow?

I think it is that the spectrum colors are more distinct and not "fuzzy" like a rainbow but I'm not sure

true. The sunlight spectrum is the result of all elements spectra coming from the sun, whereas one atom is a tiny part of the spectum.