There is a pretty good explanation

here.

As far as I understand it, it is a relatively straightforward equation with many constants:

Weapon power: The average damage of a weapon

Armor: The listed armor value corresponding to the siding that has been hit.

DamageModifier: A % damage multiplier.

The only random element comes from the damage rule. In XCom:EU, damage is anywhere between 0% and 200% of the weapon power. In XCom:TftD, damage ranges between 50% and 150%. In either case, the average damage is 100% damage, which means the average damage is equal to the weapon power. It does make a big difference in extremes though (A rookie without armor will almost always die in TftD, whereas you might survive in EU if the random damage is low; conversely, an operative in the best armor in TftD is more likely to survive a direct hit, taking at most 150% of weapon damage, instead of up to 200%).

The equation is then: Damage = (Weapon power * Random damage * Damage Modifier) - Armor.

So if you are taking a plasma pistol hit (Weapon power = 52) to the face (front siding) and you are wearing power armor (Front armor 100, Damage Modifier: 1), with normal EU damage rules, you get:

Damage = (52 * (0% to 200%) * 1) - 100 = (0 to 104) - 100 => Most probably no damage, with a little chance of up to 4 damage.

If you were using the TftD rules, you would take:

Damage = (52 * (50% to 150%) * 1) - 100 = (26 to 78) - 100 => No damage ever(!)

Wearing coveralls, (front armor 12), means you take 0 to 92 with EU rule, or 14 to 66 with TftD rule. Both armor and damage rule can make a big difference!