The esophagus does not rely on gravity to take food to the stomach. It uses rhythmic contractions of the muscles to force food in the correct direction. This can be demonstrated by trying to swallow while hanging upside down. There is also a flap where the esophagus exits into the stomach that prevents food and stomach acid from coming up into the esophagus.
Unlike the stomach, the esophagus has no mucous lining to protect it from stomach acid. As a result, when acid does back up into the esophagus, the result is the pain of heartburn. Constant heartburn, such as is common in acid reflux (Gastro-Esophagal Reflux Disease) can badly damage the esophagus which can lead to a higher risk of cancer.