Normally when a photon of light encounters any form of matter (solid, liquid,gas) there is a chance that it will get absorbed by an electron. Generally this will only happen if the energy of the photon is able to push the electron to a higher energy level. Different materials tend to absorb specific wavelength (energies) of light and the remaining colors are what we see as the color of the material (lemonade looks yellow because the other colors have been absorbed). Some materials (air, water, glass) absorb almost none of the visible wavelengths, and so appear transparent. The process is not perfect, the thicker a sheet of glass is, the more obvious it becomes that at least some of the light is being absorbed. Most glass will absorb light in the ultraviolet range, which is why trying to sunbathe indoors next to a window doesn't work.