X-rays are a form of invisible radiation. Diagnostic X-rays are done to diagnose a condition while therapeutic X-rays are done to treat a certain condition, usually some kind of cancer. A chest X-ray would be a diagnostic X-ray to diagnose a condition in the chest, and a dental X-ray would be done to check your teeth.
While unnecessary radiation exposure should generally be avoided while pregnant, diagnostic X-rays to determine or diagnose a condition or disease are safe. The radiation associated with diagnostic X-rays are well below unsafe levels and there is no evidence that they will harm the fetus. In addition, most X-rays are done away from the uterus and the abdomen is usually shielded to prevent radiation from getting there.
If there is a good reason for a chest X-ray (for example), or a dental X-ray, or other tests, the amount of radiation exposure to the fetus is minimal, especially when the abdomen is shielded with lead. In fact, according to some experts, you might receive a similar amount of radiation by taking several commercial airplane flights (due to cosmic radiation from the sun and other stars). There is no evidence that modern microwave ovens or computer terminals expose women or their fetuses to harmful radiation.