We present a detailed model of formation of the lightcurves of accretion po
wered pulsars. We calculate the radiation field at the surface of a neutron
star by solving radiative transfer on the magnetized accretion cap and inc
lude the effects of gravitational light deflection. The outgoing radiation
may be absorbed by the accretion flow at some phases. We present the simula
ted pulse profiles and compare them with the observed pulse profiles of acc
retion powered X-ray pulsars.