Gastric acid
The highest concentration that gastric acid reaches in the stomach is 160 mM in the canaliculi. This is about 3 million times that of arterial blood, but almost exactly isotonic with other bodily fluids. The lowest pH of the secreted acid is 0.8, but the acid is diluted in the stomach lumen to a pH between 1 and 3.
Ion trapping
The charge of a molecule depends upon the pH of its solution. In an acidic medium, basic drugs are more charged and acidic drugs are less charged. The converse is true in a basic medium. For example, Naproxen is a non-steroidal anti-inflammatory drug that is a weak acid (its pKa value is 5.0). The gastric juice has a pH of 2.0. It is a three-fold difference (due to log scale) between its pH and its pKa; therefore there is a 1000× difference between the charged and uncharged concentrations. So, in this case, for every one molecule of charged Naproxen, there are 1000 molecules of uncharged Naproxen at a pH of 2. This is why weak acids are better absorbed from the stomach and weak bases from intestine where the pH is alkaline. When pH of a solution is equal to pKa of dissolved drug, then 50% of the drug is ionized, another 50% is unionized. This is described by the Henderson-Hasselbalch equation.