Many drugs are either weak acids or weak bases in the largely aqueous environment of the body, meaning that they either donate or accept protons or hydrogen ions, depending on the pH. At neutral pH, a weak drug tends to donate or lose a proton to become negatively ionized or charged, while a weak base tends to accept or gain a proton to become positively charged. This charge can influence a drug's absorption, its distribution between compartments, and its elimination from the body, since a molecule which is charged, whether positively or negatively, will have a reduced ability to cross biological membranes by passive diffusion. The proportion of drug that is ionized in a given compartment would depend on the pH of the compartment relative to the drug's pKa, which is the pH at which 50% of the drug is charged. Many compartments have different pHs.
The stomach is acidic, the small intestine can be weakly basic, the blood has a pH of about 7, and the pH of urine in the kidney tubules and bladder can vary from acidic to basic. At the low pH of the stomach, an acidic drug will be uncharged and may therefore be efficiently absorbed from this compartment. On the other hand, a basic drug will accept a proton to become positively charged in the stomach and will therefore be poorly absorbed. Conversely, at the high pH of the small intestine, an acidic drug will be negatively charged and poorly absorbed, whereas a basic drug will be uncharged and therefore efficiently absorbed. The law of mass action governs the available drug that can leave a compartment.
As the uncharged portion of the drug leaves the compartment, The number of charged molecules will decrease to maintain the balance of charged and uncharged molecules at the given pH. Clinically, we can alter the pH of a compartment to change the drug's degree of ionization, in order to influence its ability to leave that compartment. For example, in some instances of drug overdose, we can increase the pH of the fluid being filtered by the kidney by giving a solution of sodium lactate. to sequester or trap an acidic drug in the urine because it will be readily filtered by the kidney glomerulus but in a compartment with a high pH such as the tubule fluid of the kidney it will be more charged and therefore reabsorption will be reduced from the renal tubule back into the body.
It is therefore more efficiently cleared from the body by excretion in the urine.