Heartburn is caused by the relaxation of the valve between the stomach and esophagus due to pregnancy hormones, allowing stomach acid to reflux. To alleviate heartburn, pregnant women should eat smaller, more frequent meals, avoid spicy and fatty foods, and refrain from lying down immediately after eating. Over-the-counter antacids may be recommended, but it is important to consult a healthcare provider before taking any medication.