Fireflies (which are really a kind of beetle) make their own light using a chemical reaction in their bellies. A substance called luciferin reacts with oxygen, helped along by an enzyme called luciferase, and the energy released comes out almost entirely as light. Hardly any of it becomes heat - so unlike a lightbulb, a glowing firefly is cool to the touch.
Each species of firefly has its own coded flash. Some give two quick flashes a second apart. Some flash high, then dip low. Some hover and pulse. Males signal with their pattern, and females of the same species recognize it and signal back from the grass.
It gets twistier. Some βfemme fataleβ fireflies of one species can copy the flash pattern of a totally different species. When a hopeful male of that other species comes in expecting a date, she eats him.