There shouldn't be any need at all to shout or smack a foal. If you stand up square to them when they play up, take a step towards them, look them in the eye and say 'no' firmly they usually get the idea.
A foal that physically attacked me would get a smack but very little else warrants it IMHO.
Andy (eight month old foal) made the unfortunate mistake of grabbing my face with his teeth two days after I brought him home. So I grabbed him back - held onto his top lip and ranted at him. He never bit me again. No need to smack him at all.
I have smacked foals - we had a colt who double-barrelled me as he went past - I had a halter in my hand and wapped him with it as he went. But the trying it on behaviour is absolutely normal, and best solved simply by standing up to them and firmly making what you want clear. Smacking them really isn't very productive - it might stop them, but it doesn't show them what you do want. Squaring up to them, making them back out of your space and insisting that they listen makes it very clear that you expect them to listen, that you want their respect, and that you are confident enough to be in charge. You earn their respect, their trust, and their attention that way.
It's basically about learning to use the language a foal understands - and a foal will always understand horse better than smacking.