Over a hundred years ago, the study of gas discharges led to the discovery of anode and cathode rays, which turned out to be positive ions and electrons. We got better at separation of these positive ions which enabled the discovery of stable isotopes of the elements. The first such discovery was with neon, which was shown by mass spectrometry to have at least two stable isotopes: neon-20 with 10 protons and 10 neutrons and neon-22 with 10 protons and 12 neutrons. Mass spectrometers were used in the Manhattan Project for the separation of isotopes of uranium necessary to create the atomic bomb. Here’s how they work…
Atoms can be deflected by magnetic fields – provided the atom is first turned into an ion. Electrically charged particles are affected by a magnetic field although electrically neutral ones aren’t.
The sequence is :
Stage 1: Ionisation
The atom is ionised by knocking one or more electrons off to give a positive ion. This is true even for things which you would normally expect to form negative ions (chlorine, for example) or never form ions at all (argon, for example). Mass spectrometers always work with positive ions.
Stage 2: Acceleration and velocity selection
The ions are accelerated, then pass through crossed E and B fields which act as a velocity selector. Only ions having identical velocities can pass through a slit and into the magnetic field chamber.
Stage 3: Deflection
The ions are then deflected by a magnetic field according to their masses. The lighter they are, the more they are deflected.
The amount of deflection also depends on the number of positive charges on the ion – in other words, on how many electrons were knocked off in the first stage. The more the ion is charged, the more it gets deflected.
Stage 4: Detection
Here’s the maths – it’s not difficult.