We have all taken those medicines that say on the label something along the lines of "Do not take on an empty stomach. Do not use with antacid stomach remedies", but what does this actually mean?
To start with let's think about digestion. You probably know that the stomach is acidic and this is necessary for the digestion of food. A healthy stomach has a pH of around 2 - the lower the number on the pH scale, the more acidic it is and each jump of one means a 10-fold difference in pH. This means that a pH of 2 is around around one million times more acid than pure water, which has a pH of 7. This level of acidity is capable of dissolving teeth or metal - and it's all swilling around in your stomach right now! Luckily for us, our body has considered this minor problem and the lining of the stomach secretes loads of mucus to protect our stomachs from being digested by themselves (attack by acid is what is happening if you get a stomach ulcer by the way).
So what is the point of having such a low pH in the stomach? Well it's actually important for digestion of food. After the mashing that goes on in the mouth, food is further broken down in the stomach by the combined effects of the acid environment and various enzymes. Think about proteins - these are long tangled chains of amino acids which are broken up by digestive enzymes that attack the bonds holding the amino acids together. In the tangled form, the enzymes can't get to the bonds, so the acid environment of the stomach denatures (untangles) the protein strands allowing them to be chopped up by enzymes (try the testing enzymes experiment).
If you are paying attention you may have realized that in fact enzymes are proteins themselves - so why aren't these also denatured in the acid? This is because different proteins are affected differently by harsh conditions like low or high pH, temperature extremes, etc. and stomach enzymes have evolved to actually require the acid environment to work properly. The low pH of your stomach also has one other advantage - it kills most things that manage to creep in with your food, protecting you against disease.
Now, you know that saying about foods making your mouth water? Well this is actually true. The sight and smell (or even thought) of tasty foods tells our brain to start getting ready for being fed. Our saliva production is stepped up and gastric juices are tipped into the stomach ready for any food that should come their way. The process of eating also stimulates the production of digestive juices - this is the reason that some medicines tell us to not take on an empty stomach. The manufacturers, being pretty clever, have worked the fact that our stomach is acidic into the design of the drugs. In a similar way to the protein digestive enzyme, pepsin, which requires an acidic environment to function, so do these drugs. This means that if you take them on an empty stomach or with antacid treatments (which reduce the pH of the stomach to help with heart burn or stomach ulcers), they will not be activated and won't be able to work.
If your medicine bottle ever tells you to take only with milk, that is because the acid will actually harm the medicine so you need milk to protect it from the stomach contents. Other tablets are coated so that they will not dissolve in the acid stomach but instead will make it to the small intestine which is alkaline and is the bit of your digestive system where most of the stuff in food is absorbed into your body.