PISGAH NATIONAL FOREST, N.C. — Here’s what I was told: Get away from the city, go during a new moon and keep my flashlight off. When the sky faded black enough to spot stars twinkling, I’d be able to see mushrooms glowing.

There are about 100,000 species of fungi, but only about 80 of them bioluminesce, or glow in the dark. They pop up in tropical and temperate forests in the Americas, Japan, Southeast Asia, Australia and South Africa.

They emit green light, a result of nearly the same chemical reaction that illuminates the belly of a firefly or the skin of a squid, only the resulting light is constant in the mushroom, not on-demand or reactive as in some insects or marine animals. The molecules responsible for the colors are different too. And in a study published on Wednesday in Science Advances, researchers have finally revealed what’s going on inside these flamboyant fungi — at a molecular scale.