The hydrogen spectrum showed that the levels are discrete, but what is being looked at there is the light the atom emitted. No one had probed the atom by firing anything at it.
If the levels really are discrete, there should be a way to check it without light. Fire electrons at the atoms and see how much energy they are able to hand over. That is what Franck and Hertz did in 1914.
A tube is filled with mercury vapour. A heated cathode gives off electrons, which are accelerated toward a grid by a voltage V, and an electrode beyond the grid collects them so that the current I can be measured. The electrode is held a little below the grid in voltage, so an electron that has lost its momentum never arrives.
On the way, an accelerated electron runs into a mercury atom. There are two ways the encounter can go.
One is that it simply bounces off. A mercury atom is far heavier than an electron, so the electron keeps almost all of its speed. Nothing has been handed over.
The other is that it hands energy to the atom. The amount is not free to choose. What the atom can take is the difference between its levels, and for mercury the gap just above the ground state is 4.9\,\mathrm{eV}. An electron carrying less than 4.9\,\mathrm{eV} hands over nothing, however many atoms it hits.
Raising the accelerating voltage V from 0 while measuring the current I, the current climbs, and then falls sharply once V passes 4.9\,\mathrm{V}.
Past that it climbs again, and falls again at 9.8\,\mathrm{V}. It falls at 14.7\,\mathrm{V} as well. The places where it falls are spaced 4.9\,\mathrm{V} apart.
If the atom could take energy in any amount, the curve would not look like this. The current would simply climb. Dips at even spacing are what it looks like when the amount that can be handed over is a single fixed number.
Each dip can be followed one at a time. Until V reaches 4.9\,\mathrm{V}, an electron has nothing it can give an atom, so it keeps its momentum, passes the grid and reaches the electrode. That is why the current climbs.
Once V passes 4.9\,\mathrm{V}, electrons begin handing over 4.9\,\mathrm{eV} near the grid. An electron that has handed it over is left almost at rest and cannot get past the small reverse voltage between the grid and the electrode. That is why the current falls.
Raising V further, the electron is accelerated again over the rest of the run and arrives after all, so the current climbs once more. At 9.8\,\mathrm{V} it becomes able to hand over twice on the way. The dips stand 4.9\,\mathrm{V} apart because the number of times it can hand over goes up by one.
The 4.9\,\mathrm{eV} handed to the atom does not stay there. When the atom drops back from the raised level, the difference comes out as one photon.
From h\nu = E_2 - E_1 the wavelength is \lambda = \dfrac{hc}{E_2 - E_1}, and 4.9\,\mathrm{eV} gives 254\,\mathrm{nm}. The tube does glow where the current dips, and the light measured there is ultraviolet at 254\,\mathrm{nm}.
What measuring the light gives and what the electrons found agree on the same 4.9\,\mathrm{eV}. That the levels are discrete is not a matter of how a spectrum is read. It is a property of the atom itself.