Scaring them might be a bad idea, but like Dyslexa said a bit further down, a little supprise, and letting them know that they hurt you should be enough to get the point across. Scaring the poor thing might do any number of bad things you wouldn't want to do to your 'loved' pet.