A new method for measuring absorption and gain spectra of lasers is presented. These spectra are deduced from measurements of spontaneous emission spectra at different laser currents supplemented by measurements of the laser line energy and the differential quantum efficiency. The spontaneous emission emerged from the side of the laser after traveling through a transparent cladding layer. At each current, the bias energy eV is determined. A simple theoretical model is used to convert eV to minority carrier density. The method is based on the application of general relations between the rates of spontaneous emission, stimulated emission, and optical absorption. A new general proof of these relations is presented. The gain versus carrier density relation at the laser line energy is measured for four samples having different active layer doping or Al composition. Gain increased superlinearly with carrier density in undoped and n-type samples and increased slightly sublinearly in a p-type sample. The losses at low carrier densities ranged from 100–200 cm−1. For one undoped sample, the changes in the absorption edge caused by the electron and hole densities increasing from 5×1016 to 1.1×1018 cm−3 were deduced by comparing the measured changes with a model calculation. It was found that the exponential broadening increased 20%, that the energy gap decreased 12–16 meV, and that the strength of optical absorption at low energies decreased by about a factor of 1.4.