First off, you need to determine whether it is backfiring out the exhaust or back up through the carb. We usually refer to an exhaust backfire as a "backfire", and backfiring through the carb as "spitting" or "coughing".
"Backfiring" is usually caused by a spark plug "sparking" when it isn't its turn and the exhaust valve is open. If your air/fuel mixture is too rich and you have unburned fuel in the exhaust system, cross firing from one spark plug wire to another can occur if they are touching each other and when this happens while the exhaust valve is open, it will ignite the rich / unburned mixture in the exhaust manifold and tail pipes and result in a big bang.
Having timing that is too late (retarded) can cause this same thing sometimes if your engine is running too rich. When the exhaust valve opens, the mixture isn't done burning so it ignites the unburned fuel in the exhaust system and causes a loud bang.
Back firing can also be cause by a cracked distributor cap, or one that has carbon tracking inside which causes cross firing between the terminals inside, which in turn, sends spark to a spark plug that isn't ready for it yet.
Backfiring through the carb (spitting or coughing) usually occurs in the morning when a carb's air/fuel mixture is a bit too lean. This usually goes away once the engine warms-up. It is also commonly caused by the accelerator pump inthe carb not squirting enough fuel before the main jets start working. If you spit the instant you blip the throttle it is probably the accelerator pump in the carb not working, plugged up or out of adjustment.
As with backfiring, coughing or spitting can also be caused by a bad ignition system, such as cross firing, which sends a spark to a cylinder that has the intake valve open. When that plug sparks out of turn, it lights the fuel in the cylinder and the pressure has to go somewhere... so if the intake valve is open, it goes right back up through the intake manifold and out the carb with a "spit" and sometimes even a flame.
When and how it backfires or spits will give you an indication for where to look.