Final answer:
The hyphen should be used for 'X-ray' when it is used as a modifier before a noun. Therefore, the correct answer is when 'X-ray' is an adjective.
Step-by-step explanation:
The hyphen should be used for 'X-ray' when it is used as a modifier before a noun. In this case, 'X-ray' is an adjective because it describes the noun that follows. For example, we would write 'X-ray machine' to describe a machine used for taking X-ray images. Therefore, the correct answer is option 2: when 'X-ray' is an adjective.