Creatures
The bulk of horror encounters will involve terrifying creatures your players must defeat, usually in combat. Undead creatures have been commonplace in "D&D" for years, and include the likes of living skeletons, liches, zombies and vampires. "D&D" supplements, such as the 3rd edition "Monster Manual," include rules for more-interesting undead enemies, such as the allip, a creature born out of insanity, and a suitable fit for an encounter in an asylum, for example. Humanoids can be just as horrifying, though; consider a cult of masked, torch-wielding villagers, or feral savages found in the depths of a forest. Constructs, such as golems, also make interesting horror-themed enemies.
Settings
Horror encounters are greatly helped in the terror stakes by a suitable setting. Consider claustrophobic locations, such as a room which rapidly fills with sand, or perhaps a cellar which is partially submerged by sewer water. Clichéd locations, such as crypts and graveyards, are generally acceptable to most players, and can be given a grisly twist: a cemetery filled with villagers buried alive, for instance. Mundane settings with a spooky touch --- a child's haunted nursery, complete with mysterious laughter, or a farmer's field full of eerie-looking scarecrows --- fit the bill too.
Villains
A "D&D" horror-themed adventure needs a suitable villain. Horror villains often fit into a few categories. One example is a powerful creature, such as a tyrannical necromancer or mad scientist, who fortifies his lair and waits for the players to come to her. A hidden threat, meanwhile, is a concealed villain who lurks in the background, waiting to strike. These villains include a werewolf in human form, or an evil witch disguised as a village shopkeeper. If you want to involve the players more, a potential villain might include the friend of one of their characters, who has fallen from grace, or maybe even a player's own character if that individual agrees to it beforehand.
Types of Horror
Many horror encounters involve the players being threatened by a creature or evil in some way; an enemy attacks them on the road, for example. Other encounter types exist too, though. For example, the players might be focused on trying to prevent a terrible act happening to the population of a town. More complex horror encounters could involve the possibility of the characters actually unleashing some evil themselves, or running the risk of turning to evil acts to accomplish a mission and then needing to deal with the moral consequences later.