Pulsars are very small, dense stars known as neutron stars.
The electromagnetic radiation they emit is focused like the beam of a lighthouse, sweeping through space as the star spins on its rotational axis. The strong magnetic field of the pulsar concentrates the energy so that it is emitted most strongly in two opposite directions. The pulsar is rotating so that an outside observer alternately sees the energy concentrations and the dark space between them. The most familiar analogy is to a lighthouse or the dome light on an emergency vehicle, where a steady light is shining onto a rotating mirror that directs the light in a single, but constantly changing direction. An observer who is standing still will see the light only when face to face with the mirror.