Context. We are operating an elastic light detecting and ranging system (LIDAR) for the monitoring of atmospheric conditions during regular observations of the MAGIC telescopes. Aims. We present and evaluate methods for converting aerosol extinction profiles, obtained with the LIDAR, into corrections of the reconstructed gamma-ray event energy and instrument response functions of Imaging Atmospheric Cherenkov Telescopes. Methods. We assess the performance of these correction schemes with almost seven years of Crab Nebula data obtained with the MAGIC telescopes under various zenith angles and different aerosol extinction scenarios of Cherenkov light.Results. The methods enable the reconstruction of data taken under nonoptimal atmospheric conditions with aerosol transmissions down to ∼0.65 with systematic uncertainties comparable to those for data taken under optimal conditions. For the first time, the correction of data affected by clouds has been included in the assessment. The data can also be corrected when the transmission is lower than 0.65, but the results are less accurate and suffer from larger systematics.