Adenosylcobalamin (AdoCbl), or coenzyme B12, is a cofactor for enzymes important in metabolism in humans (and other mammals) and bacteria. AdoCbl contains a Co-C bond and is extremely light sensitive, but, until recently, this light sensitivity appeared to have no physiological function. Recently, AdoCbl has been found to act as cofactor for a photoreceptor protein (CarH) that controls the expression of DNA coding for transcription of the proteins needed for synthesis of carotenes in certain non-photosynthetic bacteria. In 2015, the X-ray crystal structures of two dark states of the photoreceptor protein from the bacterium Thermus thermophilus were determined: CarH bound to AdoCbl and CarH bound to a large portion of the cognate DNA operator (and AdoCbl); a light state was also determined in which CarH was bound to cobalamin in which the Co-C bond had been broken. The breaking of the Co-C bond of Ado-Cbl acts as a trigger for the regulatory switch that allows the transcription of DNA. In the two dark states AdoCbl is bound to a conserved histidine from CarH, which displaces the lower 5,6-dimethylbenzimidazole ligand of AdoCbl. In the light state the 5’-deoxyadenosyl group of AdoCbl is replaced by a second histidine from CarH, giving a bis-histidine cobalamin and 4’,5’-anhydroadenosine. Genes for B12-dependent photoreceptors are widespread in bacteria. Control of DNA transcription may represent an evolutionarily ancient function of AdoCbl, possibly pre-dating its function as a protein cofactor.