The XG-1 is the light gun that came bundled with the Atari XEGS that was released in 1987. The XEGS, which stands for "XE Game System", was an Atari 65XE computer reworked cosmetically to give the appearance of a game console. The light gun was bundled to compete with the Nintendo Entertainment System. The XEGS came with one light gun game, called Bug Hunt. The XG-1 is compatible with the Atari 7800 video game console. And since the Atari 7800 is backwards compatible, the XG-1 also works on the Atari 2600. Atari eventually released five games on the 7800 that used the gun: Alien Brigade, Barnyard Blaster, Crossbow, Meltdown and Sentinel.
The XG-1 is simply a specialized light pen. Light pen support was built into the earliest Atari computers, but it never really caught on. In fact, all lightgun games for the XEGS could be played with the light pen and vice versa. Many users complained of horrible accuracy of the device, especially when compared to the NES Zapper. Some XEGS users preferred to rewire the Sega Master System Light Phaser for use.
Source: Wikipedia, "XG-1", available under the CC-BY-SA License.