Sixty patients in whom a biliary endoprosthesis was inserted were randomized to receive: (1) placebo, (2) aspirin, or (3) doxycycline, to study the effect on the process of sludge formation. After 2 months all endoprostheses were changed, and the amount and composition of the sludge in the patent stents was analyzed. Half of the patients dropped out. The major component (56%) of the sludge of all groups was protein. No insoluble residue was present. Major deposits of sludge were found at irregularities in the stent wall (side flaps). Both doxycycline and aspirin reduced the dry weight of the sludge. Doxycycline significantly reduced the amount of protein, but scanning electron microscopy still showed abundant bacterial growth. Aspirin reduced the content of all sludge components including protein, suggesting that it decreases "stickiness" of bile. Surprisingly, doxycycline significantly decreased the death rate in the 2 months of the study. We present further evidence for a primary role of protein deposition in the early stages of stent occlusion. This process can be partly inhibited by doxycycline and probably also by aspirin, which could lead to a significant increase in stent patency.