The quote first appears in section 146 of Nietzsche's "Beyond Good and Evil," in the section entitled "Epigrams and Interludes." The quote appears by itself and thus has no broader context, save for the rest of Nietzsche's philosophy.
The full quote reads, "Whoever fights monsters should see to it that in the process he does not become a monster. And when you look into the abyss, the abyss also looks into you." As I read it, the quote refers to the propensity for people to become that which they strive against. A good example of this concept appears in Orwell's Animal Farm, where the animals seek to overthrow the tyranny of human control only to find that the pigs, upon achieving liberation from the humans and securing power themselves, soon become indistinguishable from the humans. This point is evident in the poignant last line of Orwell's work: "The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which." In fighting monsters, the pigs in Animal Farm became precisely the monsters that they once sought to free the animals from. A similar phenomenon might be said to exist in the Bush administration's willingness to tolerate (and even encourage) the torture of "enemy combatants," despite the fact that such behavior runs counter to our professed role as "liberators" and our nation's role as the "beacon on the hill."
The second half of the quote is an extension of the first, warning that when you seek to understand the "abyss," or the darker elements of life or truth, the abyss enters you as well. The lover of knowledge cannot remain merely an observer. In observing the abyss, or "dangerous truths," man cannot avoid the consequences of his newfound knowledge.
Hope this helps.