Coherent anti-Stokes Raman spectroscopy (CARS) is applied for quantitative analysis of carbon dioxide phase composition in pores of nanoporous glass samples at nearcritical temperatures. Measurements of the 1388 1/cm Q-branch were made in a wide pressure range corresponding to coexistence of gas (gas-like), adsorbed and condensed phases within pores. At temperatures several degrees below the critical value, CARS spectra behavior is easy to interpret in terms of thermodynamic model of surface adsorption and capillary condensation. It allows estimating mass fractions of different phase components. Moreover, spectra measured at near critical temperatures 30.5 and 33°C have pronounced inhomogeneous shapes and indicate the presence of condensed phase in the volume of pores. The effect obviously reflects the fluid behaviour near the critical point in nanopores. Pores with smaller radii are filled with condensed phase at lower pressures. The analysis of the CARS spectra is informative for quantitative evaluation of phase composition in nanopores.