Diversity of secondary lichen metabolites and their relationship to substrate and environmental parameters were studied in saxicolous lichens in the Middle and South Urals of Russia. Atranorin, usnic acid, gyrophoric acid, zeorin, norstictic acid, antraquinones and stictic acid were found in 73, 42, 41, 37, 36, 35 and 32 species, respectively, of 543 taxa collected. One hundred and ninety six species (i.e., 36% of total species documented) contained no secondary metabolites. Spectra of secondary metabolites of crustose lichens varied on different rock types, while in fruticose and foliose groups only those species without lichen acids were dependent on the substrate type. In Canonical Correspondence Analysis, secondary lichen metabolites were subdivided into groups depending on the concentration of Ca and metals in the substrate. Gyrophoric, lobaric, psoromic, rhizocarpic and stictic acids were common in crustose lichens in metal-poor habitats; species with antraquinones and lichens without any secondary metabolites were most abundant on limestone (alkalic and metal-poor), while other common lichen metabolites had no to minimal dependence on the chemistry of the substrate. The two additional abiotic factors affecting the composition of secondary metabolites were the maximum temperature of the warmest month and elevation. Our results suggest a range of possible relationships exist among lichen acids, rocks and climatic parameters. Furthermore, the same metabolite may affect both accumulation of metals and stress tolerance under unfavorable conditions.