The method by which this is possible is unclear. In most cases, the ability can more accurately be described as "see-through vision" since what the viewer sees contains more information than what an X-ray scan can provide.
The TV series Smallville took the term literally, depicting what Clark sees both as an X-ray image and a clear view of normally obstructed objects. When he first develops the power in the season one episode "X-ray" he explains it to his parents, "Sometimes I can see through things, other times it's like an X-ray."
In Kryptonians, the power is attributed to the Photonucleic Effect, meaning that the ability can only be used in the presence of a yellow star. Kryptonians and Daxamites can see through any object with the exception of lead, while Martians can see through any object.