For a start, glass is not totally transparent. Look out of a window and you see a filtered world, one devoid of ultraviolet and infrared light. Admittedly, this doesn't makes much difference if all you want to know is whether it's raining. However, it does give us a vital clue as to why some solids are transparent. It's all to do with how specific wavelengths of light interact with the atoms in a solid.
Light is an electromagnetic wave, with separate electric and magnetic components.
The electrical part of the wave interacts with the negatively charged electrons in the solid, making the electrons to oscillate. The new electromagnetic wave will have the same energy and same frequency as the original wave, making the two waves indistinguishable. Because the incoming light is polarised in a certain direction, limiting the direction of oscillation, the re-radiated light is emitted either in a forwards or backwards direction relative to the original wave. However, the light emitted backwards will interact with incoming rays and get cancelled out. The rays that go forwards will pass further into the solid, repeating the process until it finally emerges from the other side.