I am dealing with my two year old's defiant behavior as well. I try my best to remain calm and consistent in telling her the rules and the reasons for them (aka hitting hurts our friends). Sometimes this works, sometimes it does not dependent upon the motivation for her behavior. Often she is simply seeking attention and testing me to see what I'll do. In instances such as those ignoring the behavior is the best approach as she no longer gets rewarded (receives attention) for poor behavior. I just had to comment on the spanking though as I feel it provides no lesson whatsoever. I tell my daughter no hitting, so how does me hitting her teach her to behave? It really doesnt. It is an outlet for the parents frustration and/or feelings of losing control. The lesson imparted onto your child is that hitting is what you do when you get really angry. I feel the best approaches are: to ignore attention seeking behavior, redirect inappropriate behaviors, distract with an acceptable activity, model or praise others good behavior and remain calm. I know my response is not entirely helpful as some of these techniques will work some of the time. Other than that the best this is the acceptance that parenting is a hard job and it is ever changing in how to handle situations.
If the behavior is fairly recent, as you said it only really got bad in the past several weeks, has there been anything that could have been a drastic change in his life, even if it seems subtle to you? Has he maybe been watching movies that have child-like violence, such as "The Incredibles" or something along those lines? Perhaps that may be why he's acting out more aggressively.
You said he's also more defiant with you than with his father. For a brief time, my son was like that with me and his father. In fact, it seemed he even had more respect for his grandmother than me! I realized this is because I'm a soft-spoken person, and not very assertive, whereas my son's father and my mother are more dominant personalities, and my son sensed this. However, I required the same respect from my son, so I approached disciplinary issues with him when he was being a good boy. I'd talk a lot with him about respectful qualities, what's nice and good behavior and what isn't, and praise him while he was in his state of "being good" while I'd talk to him. Then, when I'd sense he'd start to act out, I'd warn him and remind him of the appropriate way to behave, and if he pushed me further at that point, I'd stop it before it escalated to aggressiveness on his part or loss of my control of him. And my disciplinary measures are followed through with either time-outs, loss of privileges, or spankings, depending on his offense. Spanking him has not made him hit back at me; I've noticed his aggression is stimulated by what he sees in movies or by peer pressure. Also, I never use spanking as a last resort to bad behavior, but rather as a deterrant as soon as it starts if the offense calls for it, and I've never had to spank hard enough to hurt him. If the offense is only worthy of a time-out, the time-out is in a place of complete isolation or in a confined space. He's never laughed at me for putting him in time out, but if he did, that would not change the fact that he'd stay there. A few times he's come out of time out before his time was up, and sometimes spankings work to keep him there, but if not, then I put him in a spot where I can monitor him better to keep him there. One time, I had to keep putting him in time out in a kitchen corner over and over again for about half an hour while I was trying to cook dinner and he was throwing a fit. But by staying calm and consistent with requiring that he face the wall and keep his hands at his sides and stop screaming at me, and encouraging every moment that he'd calm down to get a breath, he eventually made it through the 2 minute time out. And all that because he wanted the M&Ms I had to go along with his chunk of chocolate (Easter candy), and I said no because he already had a piece of chocolate in his hand, so he had a tantrum. Needless to say, he got the time out AND lost the piece of chocolate until the next day.
I very rarely have disciplinary problems with him, but when I do, 90% of the time I only have to give him "the look" or a warning. Staying consistent and following through has everything to do with it.
Now I just need to get him to learn patience better... :-)
Anyway, I hope this might encourage you a bit. Keep it up, and good luck.