Seven patients with acquired immunodeficiency syndrome (AIDS) and Pneumocystis carinii pneumonia were studied to define the pathophysiology of their respiratory failure. The patients had fever, cough, dyspnea, hypoxemia, and diffuse infiltrates on chest x-ray. Biopsies revealed a spectrum of alveolar filling, interstitial edema and infiltration, and fibrosis. The patients were studied on mechanical ventilation to assess the effect of positive end-expiratory pressure (PEEP) and supplemental oxygen on shunt fraction. Mean anatomic shunt (measured on 100% oxygen) was 34 +/- 8%, which increased significantly (p less than .001) to 43 +/- 9% when the FIO2 was decreased to 40% to 60% (physiologic shunt), indicating ventilation/perfusion (V/Q) imbalance or impaired diffusion. Increasing PEEP by 9 +/- 2 cm H2O reduced the anatomic shunt to 30 +/- 7% (p less than .01) and the physiologic shunt to 37 +/- 7% (p less than .02). There was a similar decrease in anatomic and physiologic shunts in five studies, a greater decrease in physiologic shunt in four, and a greater decrease in anatomic shunt in two. Evidence of alveolar recruitment with PEEP, measured by an increase in static thoracic compliance, was found in only one study. There was no correlation between the effect of PEEP on compliance and its effect on shunt. The data suggest that in patients with AIDS and P. carinii pneumonia, PEEP can decrease shunt by reducing the anatomic shunt, improving V/Q imbalance, and converting areas of anatomic shunt to areas of low V/Q. P. carinii pneumonia in patients with AIDS can produce a clinical and pathophysiologic pattern similar to that described in the adult respiratory distress syndrome.