  Although the surface of a magnetar is a source of bright thermal X-rays, its
spectrum contains substantial non-thermal components. The X-ray emission is
pulsed, with pulsed fractions that can be as high as ~ 70%. Several properties
of magnetars indicate the presence of persistent, static currents flowing
across the stellar surface and closing within the magnetosphere. The charges
supporting these currents supply a significant optical depth to resonant
cyclotron scattering in the 1-100 keV band. Here we describe a Monte Carlo
approach to calculating the redistribution of thermal seed photons in frequency
and angle by multiple resonant scattering in the magnetosphere. The calculation
includes the full angular dependence of the cyclotron scattering cross section,
the relativistic Doppler effect due to the motion of the charges, and allows
for an arbitrary particle velocity distribution and magnetic field geometry. We
construct synthetic spectra and pulse profiles for arbitrary orientations of
the spin axis, magnetic axis, and line of sight, using a self-similar, twisted
dipole field geometry, and assuming that the seed photons are supplied by
single-temperature black body emission from the stellar surface. Pulse profiles
and 1-10 keV spectra typical of AXPs are easily produced by this model, with
pulsed fractions of ~ 50%. However, this model cannot reproduce the hard,
rising energy spectra that are observed from SGRs during periods of activity,
without overproducing the thermal emission peak. This suggests that the 1-100
keV emission of SGRs has a common origin with the hard X-ray emission detected
from some AXPs above ~20 keV.
