Question: how x ray interact with matter?
Answer: X-ray photons are created by the interaction of energetic electrons with matter at the atomic level. Photons (x-ray and gamma) end their lives by transferring their energy to electrons contained in matter.