Ultraviolet waves, X-rays and gamma rays have high frequencies, so they carry a lot of energy. X-rays and gamma rays are ionising radiation, which means they can knock electrons off atoms and damage the molecules inside living cells.
Ultraviolet waves are absorbed by the skin. Too much exposure can cause sunburn, premature skin ageing and skin cancer. UV can also damage the eyes. Dark skin contains more pigment that absorbs UV, but everyone should limit their exposure and use sunscreen.
X-rays and gamma rays pass deeper into the body. If they damage the DNA in a cell, the cell may die or it may mutate and divide in an uncontrolled way, which can cause cancer. A large dose can also cause radiation burns and sickness.
The risk depends on the dose, which is the amount of radiation absorbed. Radiographers stand behind lead screens, wear dosimeter badges and only use X-rays when the benefit to the patient outweighs the small risk.