International audienceThe peculiarities of Ramsey resonance and its sensitivity to the light shift from an optically dense medium of cold atoms are investigated. Different composite pulse protocols for clock spectroscopy, including hyper-Ramsey, modified and generalised hyper-Ramsey schemes, are compared. Error signals change significantly due to the processes of absorption and dispersion in the atomic medium. The dependence of the position of the central fringe resonance with a residual uncompensated light shift of the atomic transition is studied with the attenuation of the radiation intensity in the medium taken into account. It is shown that using a combination of generalised hyper-Ramsey error signals allows one to suppress the sensitivity to the light shift for any length of the medium