  The pulse profiles of the accreting X-ray millisecond pulsar SAX J1808.4-3658
at different energies are studied. The two main emission component, the black
body and the Comptonized tail that are clearly identified in the time-averaged
spectrum, show strong variability with the first component lagging the second
one. The observed variability can be explained if the emission is produced by
Comptonization in a hot slab (radiative shock) of Thomson optical depth ~0.3-1
at the neutron star surface. The emission patterns of the black body and the
Comptonized radiation are different: a "knife"- and a "fan"-like, respectively.
We construct a detailed model of the X-ray production accounting for the
Doppler boosting, relativistic aberration and gravitational light bending in
the Schwarzschild spacetime. We present also accurate analytical formulae for
computations of the light curves from rapidly rotating neutron stars using
formalism recently developed by Beloborodov (2002). Our model reproduces well
the pulse profiles at different energies simultaneously, corresponding phase
lags, as well as the time-averaged spectrum. We constrain the compact star mass
to be bounded between 1.2 and 1.6 solar masses. By fitting the observed
profiles, we determine the radius of the compact object to be R~11 km if M=1.6
M_sun, while for M=1.2 M_sun the best-fitting radius is ~6.5 km, indicating
that the compact object in SAX J1808.4-3658 can be a strange star. We obtain a
lower limit on the inclination of the system of 65 degrees.
