A lich (not to be confused with a lichen) is a class of monster in NetHack represented by the overall symbol L. Liches are all powerful spell-casters, and their more powerful forms have the ability to destroy armor, cast touch of death and most other spells, and teleport away when attacked; they are thus a frequent target of blessed genocide. All liches crumble to dust when killed and therefore do not leave corpses. The two most powerful kinds can be generated with athames, useful engraving weapons that are not normally generated.
Liches can make acceptable pets, but have their disadvantages. They are essentially useless against cold resistant monsters and are dangerous to abandon. The stronger versions will also always stay next to the player, which is useful if you don't have a magic whistle but also can be a nuisance by them getting in the way, and makes it difficult to stop them from killing shopkeepers. Master liches and arch-liches cannot be tamed due to their covetous nature. It is, however, possible to tame a lich or demilich and have it grow up.
The lich, L, is the least powerful monster of this class. It is slower than its brethren and not a significant threat. At the experience levels it is normally encountered, its complement of spells include healing itself, hasting itself, stunning you, turning invisible, draining your strength, destroying your armor, and cursing your items.
In addition to the spells the normal lich can cast, the demilich, L, can cast aggravate monster (awakening monsters on the level and drawing them to you).
In addition to the spells its weaker brethren can cast, the master lich, L, can also summon nasties. Master and arch-liches (usually referred to as "the purple L") can also teleport to the player, then to the upstairs to heal and back again, like a demon lord/prince.
Master-liches are generated with a 7% chance of either an athame (86% chance) or a wand of nothing, but no random offensive items.
The arch-lich, L, is the most powerful form of lich. In fact, it has the highest difficulty of all randomly generated monsters. Next to the Wizard of Yendor, it is one of the most powerful spell-casting monsters in the game. In addition to the spells its weaker brethren can cast, it has the capability to cast touch of death, bringing instadeath to the unprepared.
When you have an arch-lich as a pet, it will not attack a cockatrice.
If you teleport, a pet arch-lich will teleport itself to your new location. They will pick up and wear armor, but not wield weapons. You do not need to feed it. Note that it does *only* cold damage, so it will not be able to harm any undead creatures (even low-level ones such as kobold zombies), although it will attack them.
At their base experience level, demiliches are limited to basic monster spells. It is however possible to have demiliches generated at a high enough experience level that they can summon nasties themselves too. The boundaries between the various types of liches do not strictly correspond to the hit dice levels at which liches gain their various abilities. Thus, players who have attained high enough experience levels will encounter demiliches being generated with abilities matching master liches. The same applies to other types of liches, too; for example, many players will find liches capable of aggravating monsters, and it is possible for a master lich to be created at a high enough hit dice level to cast touch of death.
The best way to deal with a lich is to wield Magicbane to prevent the lich from cursing your inventory. Another way is to use Elbereth to prevent the lich from touching you. The Elbereth strategy will still leave you potentially open to attacks from the nasties that the liches summon.
It should be noted that the three lower lich types don't resist shock damage, thus Mjollnir is an excellent weapon to deal with them. If Mjollnir is not available, the Fire Brand will work on them as well. Arch-liches resist most elements so there is no quick way to take them down, except by hitting them with a Cockatrice or Chickatrice corpse (don't forget to wear gloves), which will turn them to stone immediately. All liches can also be disintegrated.
Also note that all types of lich count as undead and are chaotic, so if you are also chaotic, they can be tamed by reading the blessed Book of the Dead. Note that arch-liches, however, are covetous monsters that wish to possess the Book of the Dead, and therefore can only be made peaceful, not tame. A tamed arch-lich can be made using a spell of create familiar or by taming its lower brethren and then allowing them to grow up, but it's of little use as a tamed arch-lich can only cast self-beneficial spells, and therefore is rendered as a mediocre attacker that cannot even touch things immune to cold.
Liches can be prevented from teleporting by wielding a potion of paralysis, and hitting them with it while wearing a ring of free action. This should provide enough time to be able to dispose of them while they are paralyzed.
But on its heels ere the sunset faded, there came a second
apparition, striding with incredible strides and halting when
it loomed almost upon me in the red twilight-the monstrous mummy
of some ancient king still crowned with untarnished gold but
turning to my gaze a visage that more than time or the worm had
wasted. Broken swathings flapped about the skeleton legs, and
above the crown that was set with sapphires and orange rubies, a
black something swayed and nodded horribly; but, for an instant,
I did not dream what it was. Then, in its middle, two oblique
and scarlet eyes opened and glowed like hellish coals, and two
ophidian fangs glittered in an ape-like mouth. A squat, furless,
shapeless head on a neck of disproportionate extent leaned
unspeakably down and whispered in the mummy's ear. Then, with
one stride, the titanic lich took half the distance between us,
and from out the folds of the tattered sere-cloth a gaunt arm
arose, and fleshless, taloned fingers laden with glowering gems,
reached out and fumbled for my throat . . .