I recently had an episode or two of this and my surgeon said it was acid reflux; I was told not to eat or drink before sleeping, and I take an occasional Prilosec OTC if I do so inadvertantly. I also sleep with my head raised, not below my heart.
Hasn't happened since.
It's an awful taste, isn't it??