Gastric acid
The main constituent of gastric acid is hydrochloric acid which is produced by parietal cells (also called oxyntic cells) in the gastric glands in the stomach. Its secretion is a complex and relatively energetically expensive process. Parietal cells contain an extensive secretory network (called canaliculi) from which the hydrochloric acid is secreted into the lumen of the stomach. The pH of gastric acid is 1.5 to 3.5 in the human stomach lumen, the acidity being maintained by the proton pump H/K ATPase. The parietal cell releases bicarbonate into the bloodstream in the process, which causes a temporary rise of pH in the blood, known as an alkaline tide.
Indometacin
Besides, indometacin has logarithmic acid dissociation constant pKa of 3 to 4.5. Since the physiologic body pH is well above the pKa range of indometacin, most of the indometacin molecules will be disscociated into ionised form, leaving very little unionised form of indometacin to cross a cell membrane. If the pH gradient across a cell membrane is high, most of the indometacin molecules will be trapped in one side of the membrane with higher pH. This phenomenon is called "ion trapping". The phenomenon of ion trapping is particularly prominent in the stomach as pH at the stomach mucosa layer is extremely acidic, while the parietal cells are more alkaline. Therefore, indometacin are trapped inside the parietal cells in ionised form, damaging the stomach cells, causing stomach irritation. This stomach irritation can reduce if the stomach acid pH is reduced.