Get a pill-popper from the vet...it looks vaguely like a plastic syringe and you put the pill into the jaws of the device and push the plunger gently against it, ready to 'fire' it. Then - if you're right-handed - put the cat on your left thigh with a towel around its neck like a barber's cloth, closed at the back with a clothes-peg. This frees both your hands and, more to the point, keeps its feet and claws out of the equation! Then gently press the cat back into the crook of your left arm and place your left hand across its head with fingers and thumb on opposite sides of its mouth. By compressing these, you will force the cat to open its mouth and - when it does - just squeeze the pill-popper plunger with your right hand to shoot the pill into its mouth.
Might sound complicated but it works every time for me.