Because heartburn is generally caused by acid reflux, it is often worse at night when you are lying down. Acid reflux is more likely to occur then because being horizontal makes it easier for the acid in your stomach to leak through your lower esophageal sphincter and back up into your esophagus, which causes the feeling of heartburn.