In a recent work we have proven the existence of degenerate solutions to the Dirac equation, corresponding to an infinite number of different electromagnetic fields, providing also some examples regarding massless particles. In the present article our results are extended significantly, providing degenerate solutions to the Dirac equation for particles with arbitrary mass, which, under certain conditions, could be interpreted as pairs of particles (or antiparticles) moving in a potential barrier with energy equal to the height of the barrier and spin opposite to each other. We calculate the electromagnetic fields corresponding to these solutions, providing also some examples regarding both spatially constant electromagnetic fields and electromagnetic waves. Further, we discuss some potential applications of our work, mainly regarding the control of the particles outside the potential barrier, without affecting their state inside the barrier. Finally, we study the effect of small perturbations to the degenerate solutions, showing that our results are still valid, in an approximate sense, provided that the amplitude of the electromagnetic fields corresponding to the exact degenerate solutions is sufficiently small.