As I wrote earlier, the electrons of an atom don’t actually orbit the nucleus of an atom. Instead they exist in regions around the nucleus known as orbitals. Part of the reason for this is that electrons are not particles in the way we traditionally think of particles. Instead they are quanta, which have both particle-like features and wave-like features.
This particle-wave “duality” as it is sometimes called means that even though electrons don’t orbit the nucleus like a planet orbiting the Sun, there are still some “planet-like” behaviors. For example, when a planet orbits the Sun, it has a property known as rotational momentum (or angular momentum) which depends upon how fast it is moving and how far away it is from the Sun. The angular momentum of a planet is a measure of its rotation about the Sun.
Electrons in an atom also have a kind of rotational momentum, called orbital angular momentum. This is similar to rotational momentum, but because electrons are quanta there are some important differences. One of these is that orbital angular momentum is quantized. An electron can only have certain values. The second is that certain atomic energy levels can have multiple orbital angular momenta. When an electron transits from one energy level to another (emitting light in the process) it can transit to different orbital angular momenta.
In a simple atom or molecule these orbital angular momenta don’t affect the line spectra of the atom or molecule. However if the atom is placed in a strong magnetic field, it can have an effect, known as the Zeeman effect.
If the electron were orbiting the nucleus like a planet, then the charge of the electron would radiate electromagnetic energy (light) as it moved around the nucleus. Since the orbitals of an electron are quantized, this doesn’t happen, but the orbital of an electron does create a small magnetic field known as the magnetic moment. The strength and orientation of the magnetic field depends on the orbital angular momentum.
The magnetic moment of a particular orbital acts almost like small magnet. In the presence of a magnetic field, a magnet tries to align with the magnetic field, just as a compass needle tries to point north. When an atom is in a strong magnetic field, the different magnetic moments of the orbitals try to align with the magnetic field. This causes their energy levels to change slightly.
This means the orbital angular momentum *does* have an effect on the line spectra. Electrons that transit from one energy level to another, but with different orbital angular momenta, will all have slightly different energies. So instead of seeing just one emission line, you see multiple lines close together. The spectral line is split into multiple lines by the magnetic field.
You can see this effect in the image above. It looks at the emission line measured across a sunspot. You can see that in the region of the sunspot a single emission line is split into three lines. This means there is a strong magnetic field in the location of the sunspot.
By observing the splitting of line spectra we can measure the strength of a magnetic field at the source of the light. This is how we first came to understand the connection between sunspots and the Sun’s magnetic field. Since then we’ve used this trick to study the magnetic fields of lots of astronomical objects.