Lava is the most deadly terrain. Unless you are levitating or immune to fire stepping in lava means instant death. The same is true for monsters. If you attempt to step into lava that you can see, you will recieve the message "That would be certain death!" and the move will be cancelled. However, if you cannot see the lava (for example, due to wearing a cursed Ring of Clairvoyance) the game will allow you to step to your fiery death.
Lava also acts as a light source. Any tile within two spaces from the lava is illuminated, so if you're going for a stealth build, it's recommended that you give lava a wide berth whenever possible.
As of 1.7.1, throwing an item into lava creates a 1 cell gout of flame, which can ignite flammable gas clouds or anything that flies into it. If the gout is created next to flammable terrain, flammable items (scrolls), or mobs, there is a chance that fire will spread from the lava to the adjacent spot/entity.
There are three types of lava: regular lava, sacrificial pits, and cooling lava. Sacrificial pits are created in a key holder on the square of a sacrificial altar after the marked sacrifice is sacrificed. Walking into one is forbidden, but if you do, you will die just like normal lava. Another key holder contains a key/crystal orb in the middle of a lake of lava, and after obtaining the key or orb, some of the lava will turn into cooling lava, which releases steam and turns into obsidian ground after some time.
The Amulet of Yendor, if thrown into lava, will not burn, but instead will drift around like it was in water, to prevent softlocking.