We propose an original method for analytically solving the propagation equation in a resonant dense medium, and we give explicit solutions, using a parametric formulation under the thin-sample approximation. We then use the knowledge of the field transformation in a single-pass process to study the transmission of a resonant dense medium inserted into a ring cavity. Implicit analytical results are given, together with an explicit formula under the thin-film approximation. The nonlinear phase shift that is associated with propagation through the medium is shown to have a great influence on the cavity transmission. Optical bistability is obtained in the most general case. We can easily adjust the switching intensities and the intensity shift by modifying the initial cavity detuning phi(0). For positive cavity detunings, perfect optical limiting can be obtained: Induced absorptive and dispersive losses limit the output intensity. This device can lead to the stabilization of a noisy incident continuous wave or to the realization of optical limiters. (C) 1999 Optical Society of America [S0740-3224(99)01611-2].