Patients receive the standard dose of AZT at study entry. Low body weight patients receive AZT at a lower dose. Patients are randomly assigned to one of two medications intended to prevent the recurrence of PCP. Patients assigned to SMX/TMP will take 1 capsule which contains both drugs once a day for 1 year. Patients assigned to PEN will have 1 aerosol treatment every 4 weeks for 1 year. Blood will be drawn at intervals in order to estimate blood levels of the drugs and to detect any adverse effects from the drugs. Note: Earlier versions of this protocol reflect its original design as a 3-arm study comparing aerosolized PEN, SMX/TMP, and pyrimethamine-sulfadoxine as secondary prophylaxis of PCP in AIDS patients receiving AZT. In order to reduce the effective sample size and permit the completion of accrual in a reasonable period of time, the pyrimethamine - sulfadoxine arm of this study has been discontinued. Patients randomized to this arm will be continued in this study on the original randomized therapy. Management of these patients will follow that described for SMX/TMP in the latest protocol version. AMENDED: Lower dose of AZT allowed.