  We present a Comptonization model for the observed properties of the
energy-dependent soft/hard time lags and pulsed fraction (amplitude) associated
with the pulsed emission of a neutron star (NS). We account for the soft lags
by downscattering of hard X-ray photons in the relatively cold plasma of the
disk or NS surface. A fraction of the soft X-ray photons coming from the disk
or NS surface upscatter off hot electrons in the accretion column. This effect
leads to hard lags as a result of thermal Comptonization of the soft photons.
This model reproduces the observed soft and hard lags due to the down- and
upscattered radiation as a function of the electron number densities of the
reflector, n_{e}^{ref}, and the accretion column, n_{e}^{hot}. In the case of
the accretion-powered millisecond pulsars IGR J00291+5934, XTE J1751-305, and
SAX J1808.4-3658, the observed time lags agree well with the model. Soft lags
are observed only if n_e^{ref} << n_e^{hot}. Scattering of the pulsed emission
in the NS environment may account for the observed time lags as a non-monotonic
function of energy. The time lag measurements can be used as a probe of the
innermost parts of the NS and accretion disk. We determine the upper and lower
limits of the density variation in this region using the observed time lags.
The observed energy-dependent pulsed amplitude allows us to infer a variation
of the Thomson optical depth of the Compton cloud in which the accretion column
is embedded.
