Plant secondary chemistry is determined by both genetic and environmental factors, and while large intraspecific variation in secondary chemistry has been reported frequently, the levels of genetic variation of many secondary metabolites in forest trees in the context of potential resistance against pests have been rarely investigated. We examined the effect of tree genotype and environment/site on the variation in defensive secondary chemistry of lodgepole pine, Pinus contorta var. latifolia, against the fungus, Grosmannia clavigera (formerly known as Ophiostoma clavigerum), associated with the mountain pine beetle, Dendroctonus ponderosae. Terpenoids were analyzed in phloem samples from 887, 20-yr-old trees originating from 45 half-sibling families planted at two sites. Samples were collected both pre- and post-inoculation with G. clavigera. Significant variation in constitutive and induced terpenoid compounds was attributed to differences among families. The response to the challenge inoculation with G. clavigera was strong for some individual compounds, but primarily for monoterpenoids. Environment (site) also had a significant effect on the accumulation of some compounds, whereas for others, no significant environmental effect occurred. However, for a few compounds significant family x environment interactions were found. These results suggest that P. c. latifolia secondary chemistry is under strong genetic control, but the effects depend on the individual compounds and whether or not they are expressed constitutively or following induction.