While all attacks deal damage, not all attacks do so in the same way. Each attack deals specific kinds of damage. AC protects against all damage unless otherwise stated, but other specialized resistances can help take the blow down further.
Physical damage is the most common kind of damage in the game. Almost every monster deals it with their base attacks, and many Earth Magic spells deal it as well. Physical damage is reduced by an amount ranging from 0 to the target's AC, like most other types of damage shown. Many elementally branded melee attacks must deal at least 1 physical damage to deal elemental damage.
This is the only type of damage affected by guaranteed damage reduction, and only if the source of the damage is melee combat.
Fire damage is usually caused by spells and abilities, but certain weapon brands also cause it. Fire resistance protects against it. Note that melee attacks that deal fire damage (either from a branded weapon or a monster with a natural fire attack) are an exception to the chart below: the fire component of the attack deals 200% damage to vulnerable foes, instead of 150%.
Steam damage is caused by a variety of monster abilities and spells, as well as steam clouds. Steam resistance provides complete immunity to steam damage, but the clouds will still block your line of sight. A single rank of Fire resistance will grant steam resistance.
Cold damage is usually caused by spells and abilities, but certain weapon brands also cause it. Cold resistance protects against it. As with fiery melee attacks, cold melee attacks are also an exception: their cold damage component deals 200% damage to vulnerable foes, instead of 150%.
Physical + Ice
Many ice spells cause hybrid damage, dealing 60% physical damage and 40% ice damage.
The following spells are this damage type:
Negative energy damage is the result of many Necromancy spells, some undead monster attacks, and certain weapon brands. Some of these attacks have an additional draining effect, reducing a player's maximum HP or a monster's HD. Life protection resists both the damage dealt and the XP loss. Undead and demonic monsters are naturally immune to it, as are undead players.
Torment damage is a particularly devastating kind of negative energy, caused through a wide variety of evil sources. It normally deals damage equal to half the HP of the target, but this percentage can be reduced in a number of ways. In addition to life protection (with a reduced effect), the form-specific rTorm cuts the damage in half, and there are a few other ways to reduce it further. AC does not apply. See the torment article for details.
Poison damage is normally caused by being poisoned, though some poison attacks also deal immediate poison damage on impact. Poison resistance makes it nearly impossible to become poisoned, reduces the direct poison impact, and poison over time. Undead and demonic monsters are naturally immune to it, as are undead players. AC can reduce the blow, but not the poison damage itself.
Acid damage is caused by the attacks of certain monsters and a few abilities. Acid damage also may cause corrosion of your weapons and armour, temporarily reducing their effectiveness (AC and Slaying) by a value of 4 per stack. rCorr, or Acid Resistance reduces both damage and the corrosion chance.
Electric damage is a fairly rare, but variable damage type. Many sources have extremely high damage caps, which is a property of the attacks rather than electricity itself. rElec reduces damage, but is quite rare itself, the only "main" resistance to not have a ring type dedicated to it.
Smiting attacks are the result of divine or infernal wrath directed against the target. They don't do much damage, but they are completely unavoidable and there is very little one can do about it. At present, only the unique damage reduction granted to Deep Dwarves can reduce smite damage.