Because you are laying down, that is why you are having this issue. Gravity is your friend in this case... Try propping yourself upright. Everything in your body is getting loose, getting ready for delivery. Totally normal.
A way to fight the heartburn, besides propping more upright to sleep, is take a shot of apple cider vinegar. Shot glass of that stuff, burns like hell, makes you want to be sick, but it is a natural way to stop heartburn. Lasts longer and is all natural so it is better for you because it doesn't stop digestion like antacids do, it helps with digestion as well.
I had severe heart burn during my 1st pregnancy. I ended up sleeping on the couch where I could sit up more. Laying in bed was awful. I would watch what you eat during the day also. Of all things to give me heart burn now is pepper. If I put pepper on anything I feel like I am going to die. It's awful.