First time, say "No hitting." Take her hand in yours and rub/pet your face and asy "Nice hands."
Second time. Put her down, say "No hitting" and walk away (even just a few feet). When she gets upset and goes to you say, "Sorry for hitting Mommy?" and do the "Nice hands" thing again.
Be CONSISTENT! With you your husband, grandma, whoever. It will take a few days, but she will get the message.
Don't yell, don't hit her back, just be firm and for heavens sake, don't laugh. Right now, it is not vicious, but a game for her. Don't encourage it.
I have a four year old and a 13 month old daughters. I find this age tough, because you think of her as your sweet little baby. But at this age, they are starting to get mischievious and naughty, testing boundaries, etc. It is not too soon to start developing your calm disciplinarian Mommy persona. Trust me, it will serve you well in the next few years :)