Thorns (a.k.a. Melee and ranged attackers take X damage) are a secondary statistic in Diablo III that can appear on any non-weapon item (although Faithful Memory, Neanderthal and Nailbiter weapons can roll Thorns as well).
Thorns automatically cause damaging hit to any melee or ranged direct attacker. Damage type of this hit is not elemental; if used against players, it takes average of resistances to mitigate (Armor also works against it). It also does not trigger any other effects and does not benefit from elemental skill damage bonuses.
Thorns damage is increased by your primary attribute, 1% per point, as any other damage. However, it may not score Critical Hits, and does not benefit from it in any way.
There are Thorns-centered builds, particularly for Crusaders, and even skill runes and passive skills and items that enhance the Thorns damage or grant it special properties. Thorns can trigger special effects where possible, but have the proc coefficient of zero. Many items, gems (Topaz in weapons and Boyarsky's Chip) and even one set enhance Thorns. Note that most percentage enhancements of Thorns from items or skills are additive, stacking directly (not multiplicatively). Vo'Toyias Spiker and some other temporary effects are exceptions, being multiplicative to all other enhancements.
At level 70, most items can roll up to 2800 Thorns damage, while helms, chests, amulets, pauldrons and belts can roll up to 7696, to a total of 58080 on all slots except main and off hands (73492 with weapons and shields). With Ancient Legendary items, these values can go up to 75504 / 95540. A Topaz gem in the weapon socket can also add up to 38000 damage to Thorns. +999 / 6000 Thorns damage can be gained from Demon's Hide / Demon's Skin sets.
Overall, for all classes but Crusaders with Thorns of the Invoker set, it is not a major source of damage. However, a good assortment of protection can make the total damage inflicted with Thorns quite considerable, easily allowing a player with sufficient primary stat and/or thorns to make monsters lose more Life per hit than the damage they successfully inflict upon the hero. It is most effective against weak numerous attackers, especially if those are way below the character in Life and damage; on lower difficulties, one may kill most foes without as much as pressing a button. Collecting the variety of Thorns-centered gear can turn this mechanic from defensive to offensive, so a well-armed Crusader may, if desired, make it a lethal weapon.
In PvP, while it will rarely actually kill an adequately geared foe, it will add some form of extra punishment. Considering that players generally have less Toughness than monsters, it may prove even more effective in PvP than against the minions of Hell.