Both x-ray and X-ray are accepted in American and British English. The word originates from the German X-strahlen, which is capitalized because German always capitalizes its nouns (German now calls the x-ray Röntgenstrahlung after its discoverer, Wilhelm Röntgen). Since English does not capitalize all nouns, use the lowercase spelling x-ray for both noun and verb unless your dictating style guide says otherwise. Avoid all other variants, including xray, X ray, and x ray.