  A thermal radiative component is likely to accompany the first stages of the
prompt emission of Gamma-ray bursts (GRB's) and X-ray flashes (XRF's). We
analyze the effect of such a component on the observable spectrum, assuming
that the observable effects are due to a dissipation process occurring below or
near the thermal photosphere. We consider both the internal shock model and a
'slow heating' model as possible dissipation mechanisms. For comparable energy
densities in the thermal and the leptonic component, the dominant emission
mechanism is Compton scattering. This leads to a nearly flat energy spectrum
(\nu F_\nu \propto \nu^0) above the thermal peak at ~10-100 keV and below
10-100 MeV, for a wide range of optical depths 0.03 <~ \tau_{\gamma e} <~ 100,
regardless of the details of the dissipation mechanism or the strength of the
magnetic field. At lower energies steep slopes are expected, while above 100
MeV the spectrum depends on the details of the dissipation process. For higher
values of the optical depth, a Wien peak is formed at 100 keV - 1 MeV, and no
higher energy component exists. For any value of \tau_{\gamma e}, the number of
pairs produced does not exceed the baryon related electrons by a factor larger
than a few. We conclude that dissipation near the thermal photosphere can
naturally explain both the steep slopes observed at low energies and a flat
spectrum above 10 keV, thus providing an alternative scenario to the optically
thin synchrotron - SSC model.
