Black holes generate X-rays by converting the energy of gravity into the energy of heat. And the energy of heat can be so high, that is, the temperatures can be so high, that just like if you heat a piece of iron and first it glows red, and then it glows white, well if you keep on heating it higher and higher it's going to glow X-rays. And so that's the process that's happening. We're taking gravitational energy and turning it into heat energy and the heat is so high that X-rays turns out to be the place that the energy likes to come out.
Assoc. Dir., High Energy Astrophysics Div.
Harvard-Smithsonian Center for Astrophysics
It was those tell-tale x-rays that revealed evidence of what looked like a black hole during the very first flight of an x-ray satellite.
Astronomers now think there are at least 3 different kinds of black holes, though there are many mysteries left to explore.