Hi L.! I swear I could have written your request myself. I am having the same problem with my son who is 2 1/2. I read the responses for my own situation and somewhat agree. I have tried speaking with him, I have tried time outs, and now I am telling him he has to "ask nicely" when he would like something/to do something and when he hits that the answer will always be no. I also praise him when he does ask for things nicely and saying please. All have had only limited success. I just bought a children's book that talks about proper behavior (no hitting, kicking, spitting, etc.) It is a lift the flap book. I am hoping that may help, as well. We are as consistent as possible. We have changed day cares and after 2 weeks of being there the teacher had mentioned that he did it there as well.
This is something that we have been dealing with off and on for a couple of months now. I have noticed that it seems to occur more often when he is hungry or tired but sometimes it's just because he doesn't get his way. It also normally happens more toward the end of the day, with me (my loving husband works 2nd shift).
If anything works well for you, please let me know. I feel for you!