The X-ray spectrum of neutron stars contains absorption lines that allow direct measurement of the magnetic field strength near the surface of neutron stars: cyclotron resonant scattering features.
Their nature is related to the fact that a charged particle (e.g., an electron) performs periodic motion in a magnetic field and, under certain conditions, interacts strongly with the incident EM wave.
Let's discuss an electron with charge $-e$ and mass $m$ moving in the plane $XY$ perpendicular to the uniform magnetic field $B$.
Let's imagine that an EM wave with complex amplitude $E$ and frequency $\omega$ falls normally to the $XY$ plane on an electron moving in this way. Wave polarization is linear along the $X$ axis.
Then the motion of the electron can be considered within the framework of perturbation theory. Let $X(t)$ and $Y(t)$ be the solutions to the initial problem (without the EM wave), and $X(t) + x(t)$ and $Y(t) + y(t)$ be the solutions to the complete problem.
In the X-ray spectra of objects with strong magnetic fields, the resonance under consideration is observed as an absorption line in a smooth dependence $\Phi(E)$, where $\Phi$ is the flux density of photons with energy $E$ arriving from the object under study.