The protein that illuminates the bugs, luciferase, turns out to be closely related to one that's normally involved in basic fat metabolism. In the new paper, researchers show that, given the right chemical, the enzyme that's used to make fat can also cause the cells of a fruit fly to glow.
"In principle, the presence of a latent luciferase in fruit flies means that these insects could be rendered bioluminescent if treated with [our chemical] CycLuc2," the authors note. "However, we were unable to detect bioluminescence from fruit flies fed food containing 100 μM CycLuc2." The results suggest that a random accident—getting the right chemical in cells with a particular enzyme—provided enough glow for evolution to start selecting for it. And, with enough time, both the chemical and the enzyme became specialized, producing a brighter, more intense glow.
And, if you've ever seen a night sky filled with fireflies, you'll know it's a pretty spectacular end point for an enzyme that started out making fat.