An analysis is made of the mode structure of lasers when the interaction with the active medium is taken into account. We consider the combined effect of gain and refractive-index variations for arbitrary mirror configurations. Using a dimensionless round-trip matrix for a medium with a quadratic variation of the propagation constant with distance from the optic axis, dimensionless beam parameters are derived in terms of cavity and medium parameters. Beam waist and radius of curvature are obtained explicitly as a function of a dimensionless parameter containing the variation of propagation constant, wavelength, and cavity length. The spot size depends only on the absolute value of the gain variation, whereas the deviation of the radius of curvature of the beam from the mirror curvature changes sign when the sign of the gain variation is reversed. As long as radial gain variations are present stable oscillations can always be obtained for any set of curved and/or flat mirrors. For large gain variations the spot size and radius of curvature of the outcoming beam become independent of mirror curvatures.