Every material that has atoms with order or crystallinity has a characteristic plot of intensity versus angle 2θ when you shine an X-ray beam through it. This is because of how the atoms stack on each other in the material. And so: if you have a material you can’t identify, you can shine an X-ray beam through it and compare the plot to standard plots to figure out what material it is.
This is called X-ray diffraction or XRD. Up above you see the XRD patterns for gold, silver, and one kind of iron oxide. You can also do a little math and figure out the actual arrangement of the atoms from these plots. This is how we know the structure of many things, for example rubies.

Every material that has atoms with order or crystallinity has a characteristic plot of intensity versus angle 2θ when you shine an X-ray beam through it. This is because of how the atoms stack on each other in the material. And so: if you have a material you can’t identify, you can shine an X-ray beam through it and compare the plot to standard plots to figure out what material it is.

This is called X-ray diffraction or XRD. Up above you see the XRD patterns for gold, silver, and one kind of iron oxide. You can also do a little math and figure out the actual arrangement of the atoms from these plots. This is how we know the structure of many things, for example rubies.