Rapid loss of weight in obese patients is associated with increased saturation of bile with cholesterol, increased nucleation and growth of cholesterol crystals, and gallstones. The aims of this study were to determine the effects of rapid weight loss on contraction of the gallbladder and to evaluate the effects of ursodiol and ibuprofen on saturation, nucleation and growth, and contraction. Forty-seven obese patients entering a very low calorie dietary program were randomized to receive ursodiol, 1200 mg/day, ibuprofen, 1600 mg/day, or placebo for 12 weeks. Contraction of the gallbladder to a liquid meal was evaluated by ultrasonography, and duodenal bile was collected initially and after six and 12 weeks. Diet caused reduced contraction of the gallbladder, increased cholesterol saturation, and increased nucleation and growth of crystals. Ursodiol reduced saturation and prevented increases in nucleation and growth and contraction. Ibuprofen prevented the increase in saturation and the reduction in contraction with a trend opposing the increase in nucleation and growth. In conclusion, during dieting, contractility of the gallbladder to meals is reduced. The effectiveness of ursodiol in preventing gallstones may be explained partially by effects on contraction. Ibuprofen deserves further study because of its effects on saturation, nucleation and growth, and contraction.