Why is eating right before bed is bad?

Gravity. When you eat right before you go to bed, the food doesn't have time to pass through the stomach, so when you lie down, gravity could cause the food to go back up into the throat. This could cause heartburn, a sour taste in the mouth, and inflammation of the throat - which could lead to a cough during the day.