Go through the following question and provide the answer:
 
A patient is suffering from heartburn caused by an excess of hydrochloric acid in the stomach. Which substance would help reduce the discomfort, and how does it work?