I eat Tums like candy, and it's a good way to get the extra calcium you need. Or try drinking milk. It's basically the calcium that neutralizes the reflux. Milk is an instant relief.
Tums help a lot too. For me anyway.
As far as 'avoiding' it is concerned, your stomach is being pushed out of position and there is nothing to do to change that, short of having the baby. Some women simply do get extreme heartburn from this involuntary repositioning of their internal arrangement, others (the lucky ones) don't.
As as far as treating the symptom, ask your ob-gyn for a list of approved heartburn meds (don't take just anything, ask your doc or your pharmacist). Sitting up when sleeping can help, and other home remedies I've heard of include peppermint tea and eating papaya.