The synthesis of various unique secondary metabolites by lichens is the result of mutualistic symbiotic association between the mycobiont and autotrophic photobiont. The function of these compounds and causal factors for their production are not fully understood. This paper examines the effect of heavy-metal bioaccumulation and physiological parameters related to photosynthesis and carbon metabolism on the production of lichen substances in hyperaccumulator Diploschistes muscorum. The obtained model of secondary metabolite concentrations in the thalli demonstrates that the carbon source provided by the photobiont and associated polyols produced by the mycobiont have positive impact on the production; on the contrary, the increased intracellular load of heavy metals and excessive loss of cell membrane integrity adversely affected secondary metabolite contents. Additionally, the production of secondary metabolites appears to be more dependent on intracellular metal concentrations than on soil pollution level. To compensate for metal stress, both efficient functioning of algal component and sufficient production of secondary metabolites are required. The balanced physiological functioning of mycobiont and photobiont constitutes the complex protective mechanism to alleviate the harmful effects of heavy metal stress on primary and secondary metabolism of lichens.