When objects get very hot (or, by extension, very energetic), they give off X-rays. Some of the most intriguing objects in the Universe- black holes, exploded stars, clusters of galaxies-reveal much about themselves through X-rays.
An X-ray machine can't act like Chandra and photograph an X-ray source. Chandra, however, can act like the camera in an X-ray machine and reveal information about what's between the source and the camera.