A single ray of ordinary light, say sunlight, will be dispersed upon entering the glass of the prism into a continuous array of colors. It will be further dispersed on emerging from the prism into the air. Such an arrangement of colors is called a spectrum. In the case of sunlight, the spectrum will contain all the seven principal colors: violet, indigo, blue, green, yellow, orange and red. All the intermediate color transitions will also be present.
Two basic physical principles govern the dispersion into several colors:

When we pass a beam of white sunlight through a prism, we see a
rainbow-colored band of light
that we call a continuous spectrum.
a. Light is a form of
energy that can be thought of as consisting of waves. The experimental evidence is
that red light differs from blue light only in wave length. Red light
has the longest wave length in the visible spectrum; violet, the shortest.
Wave length,
as the name indicates, is the horizontal distance between crests of two adjacent waves.
It is usually stated in terms of an extremely small unit of length, known as an Angstrom.
One Angstrom is equal to 1/10,000,000,000 of a meter. In these units, wave
lengths of red light are approximately 8,000 Angstrom; the wave length of violet light is
about 4,000 Angstrom.

Electromagnetic radiation has wave-like characteristics. The
wavelength (lambda) is the distance between crests, the frequency (f) is the
number of cycles per second, and the speed (c) is the distance the wave covers over time.
b. The refraction suffered by light on entering glass depends on the wave length: the short wave violet is refracted more than the long wave red light. The several colors originally contained in the ray of white light are thus refracted by different amounts and hence, dispersed.
In addition to the prism, the other essential elements of a prism
spectroscope are a narrow slit, a collimator, and a telescope.
The narrow slit is the gate through which the light enters the
spectroscope. The slit is made fairly narrow to prevent overlapping of colors in the
spectrum.
The narrow slit is placed at the focus of an achromatic lens called the
"collimator", the function of which is to reroute the rays of light into
parallel paths.

Each parallel ray, on passing through the prism, is dispersed into the various colors. Thus, ray A produces a complete red-to-violet spectrum (continuous spectrum); similarly, ray B produces a complete spectrum, and so on.
The task of collecting the red components of all the rays in one place is performed by the objective of the telescope: it brings together all the dispersed red components as well as the dispersed components of the other colors, and places them side by side. The eye, looking through the eyepiece of the telescope, sees the procession of colors that is the spectrum. If some wave lengths are missing in the light entering the spectroscope, the spectrum will not be continuous. The place usually occupied by the missing wave lengths will appear black.


Photons of the proper wavelengths can be absorbed by the gas atoms and re-emitted
in random directions.
Because most of these particular photons do not reach the telescope, the spectrum
is dark at the wavelengths of the missing photons.
Some sources of light, a neon light, emit only a few definate wave lengths - the spectrum will appear as a series of bright lines seperated by wide black bands (known as an emission spectrum). Each bright line is an image of the slit in one of the wave lengths that was present in the light.