When light passes through a prism, it spreads out into an array of colors called a spectrum. The light spreads out like this because it interacts with the glass and has a slightly slower effective speed in the glass.
Different colors bend different amounts. Blue light has a shorter wavelength than red light and it bends more as it passes through the prism. This is why a prism is able to separate white light into its constituent colors.
A spectroscope, or spectrometer, uses this phenomenon to spread out light, in order to study it in more detail. A spectroscope acts like many tiny prisms to spread the light out.
A spectrum like you see coming from the prism is called a "continuous spectrum" because it contains all of the colors of light smoothly connected.
When light from an emission spectrum passes through a cooler gas, the photons interact with the gas and scatter, leaving a gap for the constituent colors.
The spectrum for hydrogen gas is shown above, comparing the emission spectrum and the absorption spectrum. The emission spectrum is black everywhere except for the bright emission bands. The absorption spectrum is a continuous spectrum with black gaps corresponding to the bright bands of the emission spectrum.
Kirchoff's laws summarize the possible kinds of spectra seen.
Light coming directly from a radiating blackbody gives a continuous spectrum. This is because it typically emits all possible wavelengths of light.
Light from a source that passes through a cloud of cool gas shows an absorption spectrum.
Light emitted by a hot cloud of gas shows an emission spectrum.
In essence, the photoelectric effect experiment provides evidence that light can behave as a particle. When we shine light onto a metal, it can cause electrons to be dislodged and leave the surface of the metal. Photons interact with electrons.
If the light has high enough frequency (alternately we could say short enough wavelength) electrons will become dislodged from the metal. Recall that the energy light is E = hf, the higher the frequency, the higher the energy.
If we lower the frequency of light, we will reach a cutoff frequency where electrons are no longer ejected from the metal. Different kinds of metals have different cutoff frequencies; the cutoff frequency is a property of the metal.
If we shine light below the cutoff frequency, electrons are not ejected even if we increase the intensity of light. You can think of intensity as the number of photons per second.
In other words, we can fire many photons at the metal and none will eject an electron if the energy is too low. We draw the conclusion that light must be behaving like a particle: a single photon dislodges a single electron from a metal.
If light were behaving like a wave, increasing the intensity would cause electrons to be ejected.
If the question is: "Does light behave like a particle or a wave?" the answer is "Yes." It behaves like a particle sometimes and like a wave sometimes, depending on the experiment and what you are measuring.
This PhET simulation provides an interactive virtual demonstration of the photoelectric effect experiment and the particle nature of photons, allowing you to change the wavelength (energy) of light, the intensity of light and the kind of metal in the experiment.
When high voltage is applied across a tube of gas, the gas glows with characteristic colors. When the light is viewed through a spectroscope, the colors separate out into bands, as seen above.
You can see that for these two gases, the spectral colors are different. The gas on the left is helium. It glows a pinkish color but more importantly, the colored bands are identifiable as having very specific colors, one red band, one yellow-orange band, two that are turquoise, one blue, one purplish blue and one violet.
The gas on the right is nitrogen. It has very many more colored bands than helium, all with specific colors of the spectrum. We call the set of colored bands an "emission spectrum" because the colors are emitted at specific wavelengths.
Every kind of gas has a unique emission spectrum, like a fingerprint. Viewing the emission spectrum of a hot gas allows us to determine what kind of gas it is.
We use spectroscopy to analyze starlight and tell us what gases are present in the star.