An X-ray (or “X-ray attack”) is a situation in which a long-range piece — a rook, bishop or queen — acts through another piece, usually an enemy one. The piece “sees through” the line: there is no direct attack, but as soon as the piece in between disappears, its effect appears.
Defending through a piece
This is the most common case. Imagine your rook, an enemy rook and another rook of yours standing on the same file. The enemy rook takes your nearer rook. It seems your rook was undefended — but after the capture your far rook immediately takes back: it was “defending” the square through the enemy rook.
So when calculating exchanges on one line, take every piece on it into account — even those standing behind enemy pieces.
Attacking through a piece
A similar idea is the skewer: a long-range piece attacks a more valuable piece, and when that piece moves away, it captures the less valuable one standing behind it on the same line. For example, a bishop checks the king, the king steps aside, and the bishop takes the rook that stood behind the king.
This is the “mirror image” of the pin: in a pin the valuable piece stands behind, in a skewer — in front.
Why it matters
The X-ray often goes unnoticed when calculating exchanges. A player counts “two of my pieces against two of my opponent's” and forgets the third, which acts through a piece. As a result the exchange ends quite differently than expected.
A tip
When several pieces stand on one line — rooks on a file, queen and bishop on a diagonal — picture what happens after each capture: which lines open and who comes under attack.
Other tactical devices: the fork, the double attack, the windmill, the intermediate move.