The performance of adaptive optics systems employing sodium laser guide stars can be improved by continuously monitoring the vertical density structure of mesospheric sodium along the line of sight. We demonstrate that sodium density profiles can be retrieved by amplitude modulation of continuous wave (CW) lasers. In an experiment conducted at the Large Zenith Telescope (LZT), ESOs Wendelstein Raman-fibre laser was amplitude-modulated with a pseudo-random binary sequence and profiles were obtained by cross-correlation of the modulation pattern with the observed return signal from the laser guide star. For comparison, high-resolution profiles were obtained simultaneously using the lidar system of the LZT. The profiles obtained by the two techniques show noise contamination, but were found to agree to within the measurement error. As a further check, a comparison was also made between several lidar profiles and those obtained by simultaneous observations using a remote telescope to image the laser plume from the side. The modulated CW lidar technique could be implemented by diverting a small fraction of the returned laser light to a photon counting detector. Theoretical analysis and numerical simulations indicate that, for 50 per cent modulation strength, the sodium centroid altitude could be retrieved every 5 s from a single laser guide star, with an accuracy which would induce a corresponding wavefront error of 50 nm for the ELT and less than 30 nm for the TMT and GMT. If multiple laser guide stars are employed, the required modulation amplitude will be smaller.