Gaseous exchange takes place by diffusion. The structure of the leaf is adapted for gaseous exchange by having intercellular spaces that are filled. These are many and large in the spongy mesophyll.
When stomata are open,carbon(IV)oxide from the atmosphere diffuses into the sub-stomatal air chambers. From here, it moves into the intercellular space in the spongy mesophyll layer.
The Cabon dioxide goes into solution when it comes into contact with the cell surface and diffuses into the cytoplasm.A concentration gradient is maintained between the cytoplasm of the cells and the intercellular spaces.
Carbon dioxide therefore continues to diffuse into the cells.The oxygen produced during photosynthesis moves out of the cells and into the intercellular spaces.
From here it moves to the substomatal air chambers and eventually diffuses out of the leaf through the stomata. At night oxygen enters the cells while Carbon dioxide moves out.