To evaluate the role of the functional Asn40Asp polymorphism in the mu-opioid receptor gene on drinking behavior and naltrexone's ability to attenuate drinking, we used a daily diary method in a 12-week, randomized clinical trial of naltrexone to reduce drinking. Participants (n = 158 problem drinkers) were assigned to receive either daily or targeted naltrexone 50 mg (n = 81) or matching placebo (n = 77). Patients reported by telephone each evening their current desire to drink and their drinking during the previous night and during the reporting day. We examined genotype, medication, desire to drink and their interactions as predictors of nighttime drinks consumed, controlling for drinking earlier in the day. Asp40 carriers showed a stronger positive association between evening desire (deviations from their mean levels) and later night drinking levels than Asn40 homozygotes (P = 0.019). The desire × genotype × medication condition interaction was also significant (P = 0.009), with a significant desire × genotype interaction for the placebo group ( P = 0.001) but not for the naltrexone group (P = 0.74). In summary, when the evening level of desire to drink was relatively high, Asp40 allele carriers were at greater risk than Asn40 homozygotes to drink more, which was attenuated by naltrexone. Although average measures across the study were not informative, daily reports helped to demonstrate the moderating effects of genetic variation on the relation between desire to drink and alcohol consumption and the effects of naltrexone on that phenotype.