Pulsars are the relics of massive stars that have ended their lives in a tremendously powerful explosion called a supernova and that have turned into highly magnetized rotating neutron stars. Emitting a beam of electromagnetic radiation in the form of radio waves, a pulsar appears to flash on and off many times a second.The radiation can only be observed when the beam of emission is pointing towards the Earth. This is called the lighthouse effect and gives rise to the pulsed nature that gives pulsars their name.
Neutron stars also have very large magnetic fields. The magnetic field on Earth, which makes compasses point north, is a trillion (1,000,000,000,000) times weaker than the typical neutron star magnetic field. The magnetic field is so strong that it causes most of the light and radiation that the neutron star emits to be concentrated into cones of emission, like beams from a lighthouse. In fact, the key to a pulsar is the combination of the extraordinary magnetic field and the rotation of a neutron star. If the neutron star is spinning, like the Earth rotates on its axis, and if the Earth happens to lie in the path of the beams, we see a pulse of light each time a beam sweeps across the earth.