  The interaction of an atomic gas confined inside a cavity with a strong
electromagnetic field is numerically and theoretically investigated in a regime
where recoil effects are not negligible. The spontaneous appearance of a
density grating (atomic bunching) accompanied by the onset of coherent
backpropagation is found to be ruled by a continuous phase-transition.
Numerical tests allow us to convincingly prove that the transition is steered
by the appearence of a periodic atomic density modulation. Consideration of
different experimental relaxation mechanisms induces us to analyze the problem
in nearly analytic form, in the large detuning limit, using both a Vlasov
approach and a Fokker-Planck description. The application of our predictions to
recent experimental findings, reported in [Phys. Rev. Lett. {\bf 91}, 183601
(2003)], yields a semi-quantitative agreement with the observations.
