Most people have their worst heartburn at night. That's because heartburn has a lot to do with gravity. When you're in bed and lying down, gravity isn't working in your favor. Here's how the problem starts. When you swallow foods and drinks, they flow through your esophagus down to your stomach. Think of the point where the esophagus and stomach meet as a gate made of a circular ring of muscle. This is the lower esophageal sphincter (LES). It opens to let food and drink pass through. As soon as they do, the gate closes. Gastric juices made in your stomach to digest food are meant to stay there. If they escape back through the LES gate, they irritate the esophagus. You then experience heartburn. The reason heartburn is worse at night is that the LES has to work against gravity. When you are lying flat, especially if you have food in your stomach, all those gastric juices are knocking at the gate. Tips for Better Sleep There are several things you can do to avoid nighttime heartburn and get the rest you need. Don't go to sleep on a full stomach. The less food you have in your stomach, the less heartburn at night. Make sure to eat your last meal of the day at least three hours before going to bed or even lying down. Eat a light healthy meal for dinner. Remember, fat takes longer to digest. Avoid foods in the evening that are linked to heartburn. Foods and drinks that often lead to heartburn include alcohol, caffeine, chocolate, citrus fruits, tomato-based foods, garlic, onions, and mint flavorings. Also, smoking will relax your LES. It’s best to quit smoking but if you smoke, avoid doing so before bedtime. Take heartburn meds the right way. If you take something for heartburn, be sure to follow the directions exactly. If your doctor has prescribed a proton pump inhibitor, it's best to take it about 30 minutes to one hour before dinner. If you take an over-the-counter antacid, take it about one hour before going to bed to prevent nighttime heartburn. Make gravity work for you. Keeping your head above stomach level will take some pressure off your LES. This will reduce heartburn. However, the answer isn't to sleep on a bunch of pillows. That just puts your body in a bad alignment. Instead, raise the head of your bed about 6 to 8 inches. To do this, put blocks or bricks under the bedposts. Sleep on your left side. Your esophagus attaches to your stomach on the right side of your belly. Sleeping on your left side takes pressure off your LES. So, try to fall asleep on your left side. If you wake up with heartburn and are in another position, flip over to your left side. Key Takeaways Heartburn often goes into full swing when you're ready to call it a day, so consider simple lifestyle changes. Plan ahead by eating a healthy dinner at least three hours before bed. Also stay away from trigger foods if you must have a snack. Raising the head of your bed can help prevent nighttime heartburn.