Preoperative cimetidine, ranitidine, or placebo were administered, orally or intravenously to 190 patients in a double-blind study. The volume and pH of gastric aspirate samples, obtained after tracheal intubation and before extubation, were measured. Both cimetidine and ranitidine produced higher mean pH levels and thus fewer patients "at risk" should gastric aspiration occur (pH less than or equal to 2.5) than did placebo. Intravenous ranitidine (in both 40- and 80-mg doses) produced fewer patients at risk in the event gastric aspiration should occur than did cimetidine, 300 mg, and the 80-mg dose produced a higher mean pH level. Oral ranitidine, 150 mg, produced a significantly higher mean pH level than did oral cimetidine, 300 mg, and tended to give fewer patients at risk. The volumes of gastric contents aspirated were similar following each of the drugs except that the volume was significantly less two hours following oral ranitidine, 150 mg, than after oral cimetidine, 300 mg.