Not that easy to rectify ...
First of all,be clear about sound.Does it comes from exhaust or from engine bay ?
Generally these type of firing happens either before combustion or after combustion chamber .
To further highlight(after combustion) ,Unburnt fuel and hydrocarbons cause the engine to misfire or backfire .
Backfiring occurs when unburnt fuel seeps through the exhaust system (because of exhaust valve not properly shut).Connection of unburnt fuel with the hot manifold components cause the engine to backfire .A flame of fire can be seen sometimes from exhaust tip as a result .
Now second (before combustion).
Fuel or hydrocarbons ignite inside intake manifold or throttle body when engine's intake valve are not properly shut causing the combustion to propagate into the intake manifold and consequently a blow back to the air filter.It may tear or burn the filter.Tish happens in the engine bay.
These were the causes of backfires .Now what cause the unburnt fuel deposits inside the system is next to know.
(1)Air/fuel ratio,
Excessive air or excessive fuel ,both.
(2)Timing,
The spark plug fires before the intake valves completely close (timing too advanced).
The combustion is not completed by the time the exhaust valves open, allowing the combustion to propagate into the exhaust system (timing too retard ).
(3)Ecu ,
If both the pre and past combustion firing is occurring at the same times,Ecu is not properly giving signals to injectors and combustion is still taking place during the exhaust stroke and when the intake valve opens.
(4)Coils,plugs and plug wires,
Any thing wrong with these components directly effect the timing of spark,if spark is in appropriate,some of the fuel is supposed to be left unburnt .
(5) fuel pump,
Sometimes low pressure of fuel pump becomes the cause of disturbance in air fuel ratio.May it be fuel pump or the clogging of filter attached with it.
(6) Catalytic converter ,
It can stop working properly when clogged too much causing the unburnt fuel go on fire in the exhaust system.
(7) Engine valves ,
Too much carbon deposits on their seats let them not properly sit back to the head and shut, causing the unburnt fuel escapes through .
(8) Quality of fuel,
Quality of fuel has direct effect in going engine rough or smooth .