Should the word be written as X-ray or x-ray?
Wikipedia capitalizes the X. Wiktionary says that x-ray is the alternative spelling of X-ray, not the other way round. Merriam-Webster capitalizes the noun but not the verb, noting that the verb is "often capitalized", too.
Looking through the first 250 cites in the Corpus of Contemporary American English, the capitalized version is preferred by a factor of 2:1; looking through the first 250 cites in the British National Corpus, it wins by a factor of 11:1.
The confusion arises from the origin of 'x-ray' (or X-ray). Wilhelm Röntgen, a German, discovered and named them. In German, however, all nouns are capitalized and other parts of speech are not. This is the origin of the capital 'X'. Ironically x-rays in German are now called 'Röntgenstrahlen', and the verb is 'röntgen', 'to x-ray'.
Compare x-rays to other wavelengths of light, gamma rays, radio waves, infrared rays, ultraviolet rays, etc. The others are lowercase in English. Pay special attention to 'gamma ray', which gets its name from a letter in another language (lowercase Greek γ). It's still lowercase in English.
Therefore, use the lowercase form; it's one fewer time you have to grab the shift key on your keyboard or smartphone!
I work on veterinary journals and our go-to dictionaries are Dorland's Illustrated Medical Dictionary (30th Ed.) and Saunders Comprehensive Veterinary Dictionary (2nd Ed.) Neither of these capitalizes x-ray (as a verb or a noun), and both dictionaries show that a hyphen is used.
I am not sure where the OP is using the term, but it seems that in medical literature the word radiograph is preferred over x-ray. Also, our authors rarely, if ever, use x-ray as a verb.
When used as a noun or a modifier, the "X" in X-ray is capitalized.
- The doctor looked at the patient's X-ray.
- Do you think all superheroes have X-ray vision?
When it is used as a verb, the "X" is usually capitalized.
- Your chest needs to be X-rayed.
However, the entry on Merriam Webster Online for X-ray as a verb lists it with a small "X". It does say, though, that the verb is often capitalized.