A solid, glowing-hot object will emit light over the full range of wavelengths resulting in a spectrum. If a diffuse and relativ
ely cool cloud of gas is located between the glowing, hot object and an observer, the observer will detect an spectrum coming out of the cloud. Another type of spectrum is given off by a neon sign which is a tube of gas whose electrons are excited by an electric current. The mostly red light given off by the sign is in the form of an spectrum.
The hot, dense source emits high energy photons of all wavelengths. Some of these photons are absorbed by electrons of cloud to excite them to a higher energy level which appear as dark lines in the spectra and we get Absorption Spectrum.