About one-fifth of all known extant fungal species form obligate symbiotic associations with green algae, cyanobacteria or with both photobionts. These symbioses, known as lichens, are one way for fungi to meet their requirement for carbohydrates. Lichens are widely believed to have arisen independently on several occasions, accounting for the high diversity and mixed occurrence of lichenized and non-lichenized (42 and 58%, respectively) fungal species within the Ascomycota. Depending on the taxonomic classification chosen, 15-18 orders of the Ascomycota include lichen-forming taxa, and 8-11 of these orders (representing about 60% of the Ascomycota species) contain both lichenized and non-lichenized species. Here we report a phylogenetic comparative analysis of the Ascomycota, a phylum that includes greater than 98% of known lichenized fungal species. Using a Bayesian phylogenetic tree sampling methodology combined with a statistical model of trait evolution, we take into account uncertainty about the phylogenetic tree and ancestral state reconstructions. Our results show that lichens evolved earlier than believed, and that gains of lichenization have been infrequent during Ascomycota evolution, but have been followed by multiple independent losses of the lichen symbiosis. As a consequence, major Ascomycota lineages of exclusively non-lichen-forming species are derived from lichen-forming ancestors. These species include taxa with important benefits and detriments to humans, such as Penicillium and Aspergillus.