When you lay down flat, gravity stops moving food and acid down the esophagus and through the digestive system, allowing the acid to pool in place and increase heartburn. Similarly, swallowing is an important force that pushes stomach acid downward, but this action is significantly reduced during sleep.