Antacids such as sodium hydrogen carbonate, magnesium hydroxide, and aluminium hydroxide work by neutralising the excess hydrochloric acid present in the stomach. However, the root cause for the release of excess acid remains untreated.
Cimetidine and ranitidine are better antacids as they control the root cause of acidity. These drugs prevent the interaction of histamine with the receptors present in the stomach walls Consequently there is a decrease in the amount of acid release by the stomach. This is why cimetidine and ranitidine are better antacids than sodium hydrogen carbonate, magnesium hydroxide, and aluminium hydroxide.