Both X-rays and Visible Light are similar in the sense that both are a form of electromagnetic radiation. However, x-rays and visible light have different wavelengths and energies. X-rays have higher energies with wavelengths ranging from 0.01 to 10 nanometers. Visible light, on the other hand, have wavelengths ranging from 390 to 700 nm. Visible light is responsible for the color we see. What we perceive is the component of visible light (wavelength of the light) that an object does not absorb - that is, the wavelength that an object reflects.
Atoms in our body tissues absorb visible light photons well (or reflect, again this depends on the wavelength compatible with the electron energies/states). Hence, visible light cannot take pictures of bones, as they cannot penetrate or pass through body tissues (e.g. skin).
On the other hand, are able to pass through (very small wavelenth, and very high energy) - that is, it is not compatible with the energy states in the atoms of tissues. Soft tissue is not dense and hence cannot block x-rays. However, bones block x-ray radiation and hence, we can take pictures of bones using x-rays. This is because bones are made up of dense material - Calcium. This is also the reason why lead is used to shield x-rays (and gamma rays, as well). The density of these materials prevent x-rays from passing through. In the case of lead, this density is due to a high atomic mass, small atomic radius, and bond lengths. The number of electrons is also higher and thus have higher tendency to scatter the x-rays.