Using rigorous diffraction theory we investigate the scattering properties of various random textures currently used for photon management in thin-film solar cells. We relate the haze and the angularly resolved scattering function of these cells to the enhancement of light absorption. A simple criterion is derived that provides an explanation why certain textures operate more beneficially than others. Using this criterion we propose a generic surface profile that outperforms the available substrates. This work facilitates the understanding of the effect of randomly textured surfaces and provides guidelines towards their optimization.