Magma is red-hot molten rock found deep within the mountain, beyond the chasm. It serves as an energy source, powering magma forges, magma glass furnaces and magma smelters. It is extremely dangerous, and has led to the death of many dwarves, and many fortresses.
If magma is channeled to the outside world it will be renamed to lava. Despite the name change, lava behaves exactly the same way as magma.
 Magma as Fuel
Magma can be used as a fuel to power furnaces and forges, reducing your reliance on charcoal and coke (they are still required as a reagent in the production of pig iron and steel). The smelter, glass furnace, and kiln can be replaced by the equivalent magma furnaces, and the metalsmith's forge can be replaced by the magma forge.
Each of these magma workshops requires one steel bar to build. You must thus build a regular smelter first, to produce your first steel bar, before you can begin magma-based operations.
Magma-fueled workshops must be placed directly over the magma flow (magma in channels cannot be used), which forces you to locate your metalworking (or glassmaking) operations deep inside the cave. However, this region is also home to the most valuable ores (gold, platinum, iron, and coal), making it a good location for your metalworks.
The magma flow will periodically spawn magma creatures which will threaten your metalworkers. This threat can be mostly addressed by building a large number of traps along the magma flow and around your workshops.
 Magma-proof Materials
Most materials will be destroyed if touched by magma, whether it is in a channel or freely flowing (i.e., flooding). However, objects made from iron, steel, adamantine, and any kind of stone will not be affected by magma. Raw stone, rough gems, and ore are immune to magma. Artifacts cannot be destroyed, regardless of what materials they are made of.
Most buildings will not be affected by magma, and any items inside workshops will also be unaffected. Weapon traps built using non-iron weapons will be destroyed, although the stone mechanisms will remain.
Creatures touched by magma will be killed almost instantly and will not leave behind a corpse (or even bones). However, bone and shell themselves are unaffected by magma. If the creature was carrying any magma-proof objects (iron, stone, bone, shell, etc), they will be left behind.
 Channeling Magma
Magma, like water, is a fluid, which can be transported to other locations via a channel, aqueduct, or bridge. When magma touches water (or vice-versa), it will create a cloud of steam which may injure any creatures caught within it.
You may also wish to build a magma-filled channel at the front of your fortress to form a lava "moat". Although water moats will keep out most creatures, if you are playing on an evil map (Sinister, Haunted, or Terrifying), you may have undead outside your fort which can cross water and will only be stopped by a lava moat.
To channel magma, you must build a floodgate beside the magma flow and attach a channel to the floodgate. If you dig a channel directly beside the magma flow (or beside a channel already filled with magma), it will fill with magma and injure or kill the miner.
Although workshops, bridges, and aqueducts built over the magma flow must be made of steel, all other buildings which come in contact with magma can be made of iron or stone instead. This includes floodgates, doors, statues, bridges, and aqueducts. Bridges or aqueducts which carry magma over other objects can be made of iron or stone, as can bridges constructed over magma-filled channels. Statues are impassable to flooding magma and can be used to block its passage.
It was once believed that magma floodgates not built from steel would be damaged or destroyed after their first use; however, subsequent observation has revealed this to be the work of magma men, which will try to destroy any doors, floodgates, or workshops they come across.