Loopy's got it right. Dirty little sneaky trick. Save game, plant spy. If you fail, reload and play your turn, try again next turn. If you succeed, save game, plant spy on next victim. Lather, rinse, repeat. (Intentionally failing to plant spies can be a great way to get someone to declare war on you, also, if you're trying to achieve that, although it's a bit pricey of a way to attempt it.)
Here is a story of spy success. To me, the Hoover Dam is a must-have wonder. In a recent game, Russia beat me to the Theory of Evolution by a turn or two, and apparently the advances they gained from that wonder were Atomic Theory and Electronics, because they immediately began constructing Hoover Dam. I went into a panic, because due to my military situation I had needed to detour from the Hoover Dam path to go for Replaceable Parts, and still needed Atomic Theory and Electronics! I put my spy in motion and investigated the city where Hoover Dam was being constructed. I had a time window of about 30 turns to research all of these technologies and construct the wonder before the Russians built it. I had a city with more than double the shield production of their constructing city, so I knew I could do this, but I had to get cracking.
First thing was to try sweet-talking the required advances from Russia. After managing to buy Atomic Theory from them for a ridiculous amount of g/pt and resources, she was, needless to say, unwilling to part with Electronics for anything. So I immediately turned around and sold Atmoic Theory to the world at large to help defray the expense of this project. And so, I called upon my spies again to steal the secret of Electronics. I was able to afford the medium-risk/success theft, so I chose it, and crossed my fingers.
Hurray, my spies were successful a turn or two later and the way was open for me to build Hoover Dam, which I did, and beat the Russians to it by approximately 8 turns. Once I had Electronics in hand and the wonder under construction, I sold off Electronics to the world, and aside from the resources/lux I had given Russia for Atomic Theory, overall this espionage adventure cost me about 1200gp out of my own pocket, which I considered money well spent. I got a wonder for not much more than what it costs to rush some improvements, and it was SO much more satisfying!
Espionage isn't for every situation, nor even for every game, but it DOES work, and if used wisely, the cost is not too great.