A new solution is presented for the puzzling, observed universality of the exponential luminosity profiles, perpendicular to the disc planes of spiral and lenticular galaxies. It is shown that such exponential z-profiles result naturally from gaseous protodiscs which settle into isothermal equilibrium prior to star formation. Subsequent cooling leads to a gravitational contraction of the gas towards the equatorial plane and to a stellar exponential z-profile if the star formation rate is assumed to be comparable to the cooling rate of the gas. The final stellar scaleheight depends only on the initial gas temperature and local surface density. This model therefore provides a new method with which to investigate the early energetic state of galactic protodiscs with measured scaleheights and surface densities along the disc plane.