We present an analysis of the phase-resolved 2-30 keV X-ray spectrum o
f the prototype magnetic cataclysmic variable AM Herculis obtained wit
h the Ginga satellite. The bremsstrahlung flux varies by more than a f
actor of 7 as a function of orbital phase, demonstrating that the X-ra
y orbital intensity variation is due to partial occultation which vari
es with the viewing angle. The spectrum is hardest when the source is
brightest in its orbital cycle, and the phase-resolved spectra are not
well fitted by simple models with a narrow line plus continuum. The d
erived high and variable bremsstrahlung temperature cannot account for
the observed line emission, and the residuals to these fits indicate
complex behaviour at high and low energies. The latter is shown to be
consistent with a complex absorber, and both partial covering and part
ial ionization give a good description of the soft spectrum. The resid
uals above 6 keV are well modelled by reflection from the white dwarf
surface, where the amount of reflection varies with phase as predicted
by the changing inclination of the white dwarf surface. The inclusion
of this hard and variable spectral component gives a temperature for
the post-shock region of approximately 13.5 keV, which is constant wit
h phase. This value is considerably lower than previous estimates, all
owing the high equivalent width of the iron line to be explained as a
combination of a thermal line blend at 6.8 keV and a 6.4-KeV fluoresce
nt component. This new low bremsstrahlung temperature suggests that th
e hard X-ray luminosities of AM Her systems may have been overestimate
d, exacerbating the soft X-ray problem. The detailed modelling of the
complex low-energy spectrum affects the derived ionization state of th
e reflector: with partial covering of cold material the reflection spe
ctrum is significantly ionized, but with an ionized absorber the refle
cting surface is cold.