Attack dogs will spot and kill spies. But if you have none available you will have to have your units force fire on the spy in order to kill it. Even units in guard mode won't kill the spy because it thinks it is one of their own. But if you don't want to risk losing him, just plant bombs on other units. One of the best units to use is your very own dogs.
Dogs are fast for one thing, and they are relatively cheap.
You can plant bombs on your own Conscripts too. It's also a good way to create diversions and keep your enemy guessing on what your next move is. If its late in the game and you have very little ore left to mine, you can use these as additional offensive units when attacking the enemy base. They will help draw fire from enemy weapons. This allows you to roll your tanks into the base while the War Miners are taking the hits.