An apparatus and method for determining the density and other properties
of a formation surrounding a borehole using a high voltage x-ray
generator. One embodiment comprises a stable compact x-ray generator
capable of providing radiation with energy of 260 keV and higher while
operating at temperatures equal to or greater than 125.degree. C. In
another embodiment, radiation is passed from an x-ray generator into the
formation; reflected radiation is detected by a short spaced radiation
detector and a long spaced radiation detector. The output of these
detectors is then used to determine the density of the formation. In one
embodiment, a reference radiation detector monitors a filtered radiation
signal. The output of this detector is used to control at least one of
the acceleration voltage and beam current of the x-ray generator.