There are a variety of explanations as to why golfers yell "fore" when hitting a golf ball. While no one is exactly sure where the term came from, it is now a commonly used way to warn other people on the golf course. Some experts suggest that the term has been used for hundreds of years, since at least the 18th or 19th century.
One possible explanation for the term is that it is meant as the seafaring term for "front." On a ship, mariners do not say "front" and "back," but rather "fore" and "aft." Shouting this term in golf is a way to warn those in front of you to look out, so this explanation certainly makes some sense.
Another explanation is military in nature. During the time period when golf was taking hold in the United Kingdom, artillery such as cannon was a mainstay of battle. As infantry traditionally marches in front of artillery, the shooters would shout warning before firing by saying "beware before." As infantrymen would need as much time as possible to tray and take cover, the term was shortened. Eventually, this may have become used on the golf course, to warn those ahead about incoming golf balls.
Other suggestions for the term include various corruptions of the word "before," as in the theory above. One interesting suggestion involves a port town called Leith in Scotland, where a defensive fort was built right above the local golf course, the famous Leith Links. During artillery practice, some experts suggest that gunners would shout "fore" as warning to the golfers below, which could explain how the term moved from a military use to a golf phrase.
According to some expert sources, such as the British Golf Museum, the term may also have developed from an early member of the golf team, the forecaddie. This man was charged with running ahead of the golfing party to mark where the golf balls landed. It is suggested that either the golfers would shout warning to their forecaddie when they were about to shoot, or the forecaddie would shout to warn anyone ahead on the course of the incoming players.
"Fore" is usually shouted when a ball has gone astray from its intended path. It is not typically used whenever a golfer shoots, just when he feels the shot will go off-target. Anyone who is on a golf course and hears someone call out should look for any incoming golf balls. Being hit by a golf ball can cause bruises, concussion, or possibly even brain or bone injuries, if the ball is traveling fast enough.