While opinions vary, one belief is if a horseshoe is nailed over a doorway open end up, it brings good luck and serves as a container that holds in the luck. In this case, hanging a horseshoe with the two ends facing down lets the luck escape. Another story says that nailing a shoe with the ends pointing down spills the luck onto the people in the house.
Folklore tells a tale of a blacksmith named Duncan who the devil came to visit. The devil wanted the blacksmith to fit him with horseshoes. Duncan recognized the devil and nailed a horseshoe to his hoof and chained him while he was in great pain.
The blacksmith kept the devil chained up and would not remove the horseshoe attached to his hoof until he promised never to enter a house with a horseshoe nailed over the door. In the story, the blacksmith would later become St. Duncan.
Another version of the horseshoe's origin as lucky states that during the Stone Age in Europe, fairies existed who went to hide in the forest once the Celtic tribes began invading the land. The fairies were blamed for committing mishaps ranging from casting spells that prevented cows from giving milk to causing infertility between couples.
It was said that the fairies were afraid of iron and that hanging a horseshoe over the doorway to a house would ward off their spells.