Human beings are prone to error.
Because human beings are also prone to drug addiction themselves, it is ideal that you always fill your prescriptions inside the pharmacy, and that immediately after paying for them, you walk over to an empty counter, open your bottle, and start counting your pills.
This can be hard for some of us who get 60, 90, 120, or greater quantities of tablets/capsules. However, if you don't want to count out the exact amount, you can be certain of a very close number. If you know 90 tablets mostly fill up a normal sized prescription medicine bottle, then at least check to see it's around the correct level.
There's almost no way to avoid doing this - unless the manufacturer creates pre-sealed bottles of the medication. I have only received this for an NSAID as of recently, but I know that there are other medications that are made this way so as to reduce possibilities for error.
The reason I suggest doing this inside the pharmacy is so that you can do it while being next to a camera, so that your actions are taped. This way, if you were shorted, there isn't a video tape of you leaving and coming back shortly - they can claim you must have eaten a few/pocketed them, even if this wasn't the case.
By counting your pills where they can see you, and/or be video taped doing so, you can clearly show that you didn't go anywhere with them, and that all you did was verify the quantity. I have never been shorted myself, although I have heard countless stories about this.
Finally I urge you to do this, especially for medications where a lack of just a few pills will make a difference. I use a benzodiazepine for anxiety, and another one for sleep, and I don't use either frequently. Other people are physically dependent on these medications - if you are in that situation, please count for your own sake.
Another idea is that the weight of a medicine bottle, the label, and pills inside should equal a very accurate amount of grams. You can haul around a hand-held scale with you, and very easily check the weight without having to count the pills. There are problems with this, since CVS and Walgreens (as just two examples of pharmacies) use different medicine bottles, and they may weigh differently. Some generic manufacturers of tablets or capsules will widely vary in weight. Finally, even if you go to two separate CVS pharmacies, one pharmacy may be out of the smallest size medicine bottle, and may have to give you a tall bottle, or a wide one, even if the medicine would otherwise easily fit in a regular sized bottle.
Cane is correct though that you should still pursue the pharmacy - if it is their error, and you know that there is no way that you took the remaining tablets, they didn't disappear and were not taken by someone who may have had access to them otherwise since they have been in your possession, then you deserve what you paid for.
In the event they will not make up the difference (they should be able to by analyzing their records, but we do not live in a perfect world), I would start going to a different pharmacy. There are, unfortunately, people who work at pharmacies who are drug addicts. Some of these drug addicted pharmacy technicians (the pharmacist is less likely to be a drug addict when compared to pharmacy technicians, although this isn't an impossible situation either) may try to cheat the system by realizing when they are going to do inventory on what classes of scheduled drugs, and then estimating how long they would like to remain an employee before quitting due to the fact that no matter what they take, as long as it is scheduled, it will eventually be discovered.
Cane is also correct because this is not Other Drugs material, as unfortunate as these events are in life, it is not going to fall within the scope of Other Drugs.