The chemical reaction between the fuel and the oxidizer produces reactant products which are nominally gasses at the pressures and temperatures in the rocket's combustion chamber.
The reaction is also highly energetic (exothermic) releasing tremendous energy in the form of heat; that is imparted to the reactant products in the combustion chamber giving this mass enormous internal energy which, when expanded through a nozzle is capable of producing very high exhaust velocities.
As the rocket moves through the atmosphere the air enters the front of the tube, where it is compressed via the ram effect.
As it travels down the tube it is further compressed and mixed with the fuel-rich exhaust from the rocket engine, which heats the air much as a combustor would in a ramjet.
In this way a fairly small rocket can be used to accelerate a much larger working mass than normal, leading to significantly higher thrust within the atmosphere.
Finally, the air ducting adds quite a bit of weight which slows the vehicle considerably towards the end of the burn.
The exhaust of that combustion then enters a convergent-divergent nozzle as in a conventional ramjet, or the ducted rocket case.
More recently, about 2002, NASA has re-examined similar technology for the GTX program as part of an effort to develop SSTO spacecraft.