I usually backfire when I have bad gas, this could be your case too. You're probably a little lean, either because you need your carb cleaned or needs to be adjusted. Try choking it when you know it's gonna do it. If it does not do it, than you know it's lean.
Have you done anything to it? All stock? Like Sparky said, I would say get the carb(s) cleaned out. That's the first step. Do you have fresh gas in it?