When an electromagnetic wave meets a substance, four things can happen. The wave can be absorbed, when its energy is transferred to the substance. It can be reflected, when it bounces off the surface. If it passes straight through, it is transmitted. If it changes direction as it passes from one substance into another, it is refracted.
Which of these happens depends on the substance and on the wavelength of the wave. Glass transmits visible light but absorbs most ultraviolet. The ozone layer absorbs most of the ultraviolet from the Sun. Water absorbs microwaves and heats up, whereas glass and plastic transmit them, so food in a glass dish can be cooked. Metals reflect microwaves and radio waves, which is why metal dishes are used to direct them.
For X-rays, bone absorbs them but soft tissue transmits most of them. That difference is what makes medical images of bones possible. A ray of light changes direction when it passes from air into glass, and this is called refraction.