The production of thymine dimers is common (many organisms cannot avoid ultraviolet light), mechanisms have evolved to repair these lesions. In nucleotide excision repair (also called dark repair), enzymes remove the pyrimidine dimer and replace it with the correct nucleotides. In E. coli, the DNA is scanned by an enzyme complex. If a distortion in the double helix is found that was introduced by the pyrimidine dimer, the enzyme complex cuts the sugar-phosphate backbone several bases upstream and downstream of the dimer, and the segment of DNA between these two cuts is then enzymatically removed. DNA pol I replaces the missing nucleotides with the correct ones and DNA ligase seals the gap in the sugar-phosphate backbone.
The direct repair (also called light repair) of thymine dimers occurs through the process of photoreactivation in the presence of visible light. An enzyme called photolyase recognizes the distortion in the DNA helix caused by the thymine dimer and binds to the dimer. Then, in the presence of visible light, the photolyase enzyme changes conformation and breaks apart the thymine dimer, allowing the thymines to again correctly base pair with the adenines on the complementary strand. Photoreactivation appears to be present in all organisms, with the exception of placental mammals, including humans. Photoreactivation is particularly important for organisms chronically exposed to ultraviolet radiation, like plants, photosynthetic bacteria, algae, and corals, to prevent the accumulation of mutations caused by thymine dimer formation.
Parker, N., Schneegurt, M., Thi Tu, A.-H., Forster, B. M., & Lister, P. (n.d.). Microbiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/microbiology