Lying down stops gravity from affecting digestion. When you lie down, gravity doesn't prevent bile and stomach acids from creating heartburn. This makes nighttime heartburn worse for many.