From the Thermodynamics Textbook
Glass allows the solar radiation to enter freely but blocks the infrared radiation emitted by the interior surfaces.This causes a rise in the interior temperature as a result of the thermal energy buildup in a space (i.e., car). 
This explanation is from what is generally a very good Thermodynamics textbook – But, most people will agree that this is wrong!
It has been demonstrated experimentally  that a “greenhouse” with a cover of rock salt (which is transparent to infra red) heats up an enclosure similarly to one with a glass cover.
Greenhouses work primarily by preventing convective cooling
Cengel  continues as follows
The surface of the earth, which warms up during the day as a result of the absorption of solar energy, cools down at night by radiating part of its energy into deep space as infrared radiation.Carbon dioxide (CO2), water vapor, and trace amounts of some other gases such as methane and nitrogen oxides act like a blanket [a] and keep the earth warm at night by blocking the heat radiated from the earth. The result is global warming.These gases are called “greenhouse gases,” with CO2 being the primary component [b].
[a]: Blankets restrict heat transfer by inhibiting heat conduction and convection – not by absorbing radiation. The vacuum of space surrounding the Earth is an excellent blanket.
[b]. CO2 makes up about 350ppm or 0.035% of the atmosphere, H2O is about 4% of the atmosphere and is a much stronger IR absorber. (ie there are approx. 100 water molecules for each CO2 molecule.)
 Yunus A. Çengel and Michael A. Boles Thermodynamics: An Engineering Approach, 7th edition McGraw-Hill 2011
 Wood, R.W. (1909). “Note on the Theory of the Greenhouse”. Philosophical Magazine 17: 319–320. http://www.wmconnolley.org.uk/sci/wood_rw.1909.html