Gas is accreted from the stellar companion and is channeled by the neutron star's magnetic field on to the magnetic poles producing two or more localized X-ray hot spots, similar to the two auroral zones on Earth, but far hotter.
Temperatures of millions of degrees are produced so the hotspots emit mostly X-rays.