Biliary tract cancer, encompassing tumors of the gallbladder, extrahepatic bile ducts and ampulla of Vater, is a rare but highly fatal malignancy. Obesity and gallstones, both related to insulin resistance, are linked to an elevated risk of biliary cancer. The peroxisome proliferator-activated receptors (PPARs) and the retinoid X receptors (RXRs), expressed in adipose tissue, play a key role in the regulation of obesity-related insulin sensitivity, thus genetic variants of these two receptor genes may be related to biliary cancer and stones. We examined the associations of seven single-nucleotide polymorphisms in the PPAR-γ, PPAR-δ, RXR-α, RXR-β and INS genes with biliary cancer and stones in a population-based case–control study in Shanghai, China. We included 237 gallbladder, 127 extrahepatic bile duct and 47 ampulla of Vater cancer cases, 895 stone cases and 786 population controls. Relative to individuals with the RXR-β C51T (rs2076310) CC genotype, those having the TT genotype had a 1.6-fold risk for bile duct cancer [odds ratio (OR) = 1.67; 95% confidence interval (CI) = 0.99–2.84], with a more pronounced association among men (OR = 2.30; 95% CI = 1.14–4.65; P interaction = 0.07). This marker was also associated with a higher risk of gallstones among subjects with a higher body mass index (BMI) (≥23 kg/m2) (OR = 1.80; 95% CI = 1.09–2.94), although the interaction with BMI was not statistically significant (P interaction = 0.28). No association was found between other variants and biliary cancers and stones. Results from this population-based study suggest that certain genetic variants involved in the regulation of obesity-related insulin sensitivity may increase susceptibility to bile duct cancer and gallstones.