First of all, the medium they are mentioning is far from empty even though it is much less dense than what we do know on Earth (see this question for more details).
Then, the problem with temperature in astrophysics is that the medium you study is in general far from thermodynamic equilibrium (thermodynamic equilibrium means that there are no flows of enery or matter within the system and with the outside of the system).
Most commonly, however, we can use another flavor of equilibrium to estimate temperature. This is the kinetic equilibrium: since most collisions are elastic (meaning that the energy is conserved), particles velocities will follow a Maxwell-Boltzmann distribution. Depending on the ionization fraction (how much is your medium ionized?) this temperature will either the kinetic temperature of electrons or the kinetic temperature of hydrogen.
Then, if you want to understand these high temperatures, you have to take into account the photoionization rate and the photoelectric heating (a process in which you eject electron from the matter of the studied medium due to UV absorption). The thermal state of the medium then depends on the equilibrium between the energy absorption by the matter and the re-emission of this energy in thermal radiation. In this framework, the energy that can be absorbed comes from the interstellar radiation field (ISRF). In the solar neighborhood, it is dominated by six different types of radiation: galactic synchrotron emission of relativistic electrons (electrons accelerated to tremendous speed in the galaxy), the cosmic microwave background, the infrared emission of the matter heated by the light emitted by stars, emission from ionized plasma, the light emitted by stars itself, and lastly X-rays from hot plasma.
References: