X-ray echoes from gamma-ray bursts