The present invention relates to a cosmetic treatment method comprising the formation of a coating on keratin fibres characterized in that it comprises: 1) the preparation of an aerogel precursor composition comprising:—at least one organic solvent chosen from acetone, C1-C4 alcohols, C1-C6 alkanes, C1-C4 ethers, which may or may not be perfluorinated, and mixtures thereof and at least one precursor compound that contains:—at least one atom chosen from silicon, titanium, aluminium and zirconium,—at least one hydroxyl or alkoxy function directly attached to the atom chosen from silicon, titanium, aluminium and zirconium by an oxygen atom, and,—optionally an organic group directly attached to the atom chosen from silicon, titanium, aluminium and zirconium by a carbon atom, 2) the removal of the solvent or solvents resulting in the formation of an aerogel composition having a bulk density less than or equal to 0.35 g/cm3, 3) the application to the keratin fibres of the aerogel composition resulting from step 2) or of the aerogel precursor composition resulting from step 1). Advantageously, the molar ratio between the precursor compounds and the solvent is at most 1/20.