In NetHack, the #offer command allows you to sacrifice a corpse upon an altar. The corpse may be in your inventory or lying upon the altar itself. It must be less than 50 turns old for the gods to accept it; this goes for corpses that do not rot (such as lizards or lichens) as well.

Offering a corpse at an altar of your own alignment will pacify your patron deity somewhat. The extent of the deity's pleasure is dictated by how they are already feeling and the level of the monster you are sacrificing. If your deity is already angry with you, you will need a substantial sacrifice in order to regain favor. Otherwise, sacrificing just about anything is immediately beneficial.

Offering a corpse on an altar that is not of your alignment has a chance of converting the altar to your own alignment. If the conversion fails, your luck will go down. If it succeeds, that altar will be treated as one of your own forevermore. If your god is angry with you and you attempt to convert an altar, you will be converted instead. This makes winning the game impossible under some circumstances (if you have not completed the Quest yet, for example).

You ascend to demigodhood by offering the Amulet of Yendor at one of the three High Altars on the very last level. If you offer enough corpses to your deity at an ordinary altar, he or she will usually reward you with artifacts. In particular, Wizards can receive Magicbane easily by sacrificing 5 to 10 creatures on the first altar you can find. #offer is the primary reason to use the scroll of create monster (or the spell or wand).