Heartburn is commonly used interchangeably with gastroesophageal reflux disease (GERD) rather than just to describe a symptom of burning in ones chest. Differential diagnosis
Heartburn-like symptoms and/or lower chest or upper abdomen may be indicative of much more sinister and/or deadly disease. Of greatest concern is to confuse heartburn (generally related to the esophagus) with a heart attack as these organs share a common nerve supply. Numerous abdominal and thoracic organs are present in that region of the body. Many different organ systems might explain the discomfort called heartburn. Heart
The most common symptom for a heart attack is chest pain. However, as many as 30% of chest pain patients undergoing cardiac catheterization have findings that do not account for their chest discomfort. These are often defined as having "atypical chest pain" or chest pain of undetermined origin. Women experiencing heart attacks may also deny classic signs and symptoms and instead complain of GI symptoms. One article estimates that ischemic heart disease may appear to be GERD in 0.6% of people. Esophagus
GERD (most common cause of heartburn) occurs when acid refluxes from the stomach and inflames the esophagus. Esophageal spasms typically occur after eating or drinking and may be combined with difficulty swallowing.
Hormonal – related to the increasing amounts of estrogen and progesterone and their effect on the LES
Mechanical – the enlarging uterus increasing intra-abdominal pressure, inducing reflux of gastric acid
Behavioral – as with other instances of heartburn, behavioral modifications can exacerbate or alleviate symptoms

Unknown origin
Functional heartburn is heartburn of unknown cause. It is commonly associated with psychiatric conditions like depression, anxiety, and panic attacks. It is also seen with other functional gastrointestinal disorders like irritable bowel syndrome and is the primary cause of lack of improvement post treatment with proton pump inhibitors (PPIs). Despite this, PPIs are still the primary treatment with response rates in about 50% of people. The diagnosis is one of elimination, based upon the Rome III criteria. It was found to be present in 22.3% of Canadians in one survey. Diagnostic approach
Heartburn can be caused by several conditions and a preliminary diagnosis of GERD is based on additional signs and symptoms. The chest pain caused by GERD has a distinct burning sensation, occurs after eating or at night, and worsens when a person lies down or bends over. It also is common in pregnant women, and may be triggered by consuming food in large quantities, or specific foods containing certain spices, high fat content, or high acid content. In young persons (typically <40 years) who present with heartburn symptoms consistent with GERD (onset after eating, when laying down, when pregnant), a physician may begin a course of PPIs to assess clinical improvement before additional testing is undergone.