Reptile lung's (scroll down a bit) Bird lungs
As you can see there are clear similarities and clear differences - the important one for birds is the direct and valved connection to the air sacs (incidently air sacs are present in many reptiles, for example, in snakes). I don't think it's actually that hard to see a evolutionary path between the two:
Initially birds evolve to breath by expanding/contracting the air sacs rather than the lungs: this is beneficial because it frees the cycle of breathing from the beat pattern of the winds.
Valves evolve at the front of the lung allowing air out but not in, meaning that air now follows a more circular path with less mixing with used air. This is directly beneficial in terms of oxygen requirements.
More valves evolve at the back of the lung to keep the air more efficently in the lungs during their contraction phase.
This system resembles the modern one, we have respiration drawing air into the posterior air sacs and then pushing them through the lungs. However the air is not yet being cleared from the lungs so some efficency is lost in mixing.
The development of anterior air sacs helps by pulling the used air out as the fresh air comes in, their placement naturally allows the used air to be blown out through the forward valve as the sacs contract but mixing will still occur as some will go back the way it came albeit at a reduced level
We're now almost there; the final stage is to add more valves to the system to prevent the re-entry of used air into the posterior sacs from the lung and the re-entry of used air from the anterior sacs to the lung. Both these adaptations have immediate benefits in terms of reducing mixing. And the system now naturally switches to the two-stage, unidirectional breathing pattern of modern birds.
This is of course pure speculation, but so is the claim that it
can't evolve. Anyone see any glaring errors in the pathway I describe above?