Most likely your mare could have been experiencing one of a few things:
Possessive issues in the field(food problems with others), space issues with you and she was telling you to back off, or she was just down right having a bad day. She could have even thought that you were intending to bring her in to do something that maybe she wasn't crazy about doing, like working lol.
Yes, I agree with the others, you should correct her for this behavior. Be careful of smacking her rear, if she is feeling a little rowdy you don't really want to be close to that region. One thing you can do with her is establish your space and hers. If she gets too close, raise your hands and waive them at her until she backs off. Eventually she will learn that she doesn't want to invade your space because you are just going to push her away. Establish your place with her, and every once and a while she will need a little reminder lol!