A maximum of 200 patients with HIV infection and either prior Pneumocystis pneumonia or a T4 lymphocyte count less than 250/mm3 will be treated orally with either weekly dapsone alone or weekly dapsone plus pyrimethamine. Initially, escalating doses of dapsone were given to groups of at least 5 patients to determine the maximum tolerated dose of weekly dapsone, (200 mg) and then a group of patients received that dose of dapsone plus 25 mg weekly of pyrimethamine to evaluate toxicity. Sequent patients are being randomized (after stratification for prior PCP) to receive dapsone 200 mg or dapsone 200mg plus pyrimethamine weekly. Patients previously entered also receive these doses. All patients will be treated for 24 months or until the development of PCP or toxicity. In this Phase I/II study, the toxicity of weekly dapsone and dapsone-pyrimethamine therapy will be evaluated, and preliminary evidence of efficacy will be obtained. This study is important because it assesses and gives alternatives to aerosolized pentamidine or sulfonamide regimens for prophylaxis against pneumonia; it offers the prospect of a very inexpensive regimen that may have potency against multiple pathogens.