I just returned from my second drive through Mexico, and I was once again stopped by corrupt Mexico City police for an ultimately unsuccessful extortion attempt. The first time was pretty stressful and we blundered through it, mainly emerging on top because of our unwillingness to pay an obviously bogus fine and our willingness to take the time to wait them out. Due to our inexperience, though, it was a long, stressful proces. My second go-round, however, went much more smoothly and relaxed than the first, due to the knowledge I'd like to impart below. Hopefully you never need to put this information to use, but in the unfortunate event that you do, I hope it will help keep you calm, relaxed, and hundreds of dollars richer than you might otherwise!
Rules of Thumb
Don't pay anything without receiving a paper ticket! Unless they provide you with a printed, official document that specifically notes your infraction, case number, and fine amount, the 'fine' they're attempting to levy, in cash, is going straight into their pocket.
You don't speak the local language. If you're in a foreign country to you, even if you're fluent in the local language, it can ease your passage to feign ignorance with the language. This makes it more difficult for them to communicate with you and they will grow tired of attempting to extort you sooner.
Stay calm. Don't get angry or combative. Cooperate with them and be cordial, but make it clear that the only pay the fine if you receive an official document. Wait to leave until they inevitably say you're allowed to leave despite your alleged multiple infractions.
Don't believe them. They will bluff in some predictable ways, but perhaps some unpredictable ways. It's safe to assume that anything they tell you is untrue.
Be patient. The name of the game here is just waiting them out. Eventually they will realize they're wasting time trying to shake you down and decide to move on to try to find an easier target, at which point they will simply allow you to leave.
If you carry a lot of cash, keep whatever cash you don't immediately need in multiple caches hidden about your vehicle. This way, if a cop attempts to outright rob you rather than simple extortion, you can remove one cache and claim it to be all you have.
Generic Things They May Try
They'll come up with any random issue or issues to 'fine' you for, usually for an exorbitant amount. Both times I've experienced this, the fine has been for hundreds of US dollars. They may even try multiple different infractions.
They may tell you that your vehicle is impounded, you'll have to leave it with them on the side of the road where it will be towed, then you can pick it up after you've paid the fine. This is a total bluff, ESPECIALLY if they won't give you an official document. Impounding and towing requires a paper trail, so they can only do this if it's a legitimate infraction, but they can threaten it all they like to extort you!
Small-town cops may ask if you have a 'gift' for them. Just keep saying that you don't have anything for them and try to keep things light.
Specific to Mexico
I've only had issues with corrupt cops on the highways around Mexico City. They seem to gather in groups on the side of the highway and flag down cars now and then to try for a shakedown.
Both times I dealt with these guys, they showed me a real rule that seemed I did appear to be breaking. In researching it later, I think they were referencing the Hoy No Circula rules for Mexico City. These rules restrict movement for certain cars to reduce traffic and smog, and have specific rules for foreign cars. However, these rules DO NOT apply for the toll highways around the city. The wording of the law does not specifically note this, however, and the cops capitalize on that. Maintain that the rule does not apply for the highway and continue to press them for an official document. If you do take Mexico City streets, you can get a 14 day pass for your foreign car.
TL;DR: DON'T PAY ANY FINES UNLESS YOU RECEIVE A PAPER TICKET