Like it or not, the law regarding media shields, or reporters' privilege, has been mostly settled, at the federal level, since 1972. In Branzburg v. Hayes, the Supreme Court ruled that reporters cannot invoke the First Amendment as justification for refusing to testify before a grand jury. Many states have taken steps to enact media shield laws, but on a federal level, Branzburg is clear.
For James Risen, that means he'll have to either testify, or sit in a jail cell for contempt. He'll have to break his promise of confidentiality to his source, and by extension, harm his ability to gather sources in the future, or he'll be imprisoned. Both outcomes will likely have a chilling effect on his future reporting.
If you haven't been following the Risen saga, he wrote a book in 2006, State of War: The Secret History of the CIA, which detailed a number of confidential operations. The best one was where the CIA attempted to implant a Russian scientist in Iran's nuclear program to sabotage it within. The scientist was to be played by John Malkovich. (Kidding, unfortunately.)
Circumstantial evidence points to the defendant, disgruntled former CIA operative Jeffrey Sterling, as the leak. Risen, however, is the only one who can provide direct evidence.
The New York Times, which employs Risen, called the Fourth Circuit's decision "egregious" and a terrible precedent for press freedom. They are correct, as is Judge Roger Gregory's dissent, which spends fifty pages making policy arguments, including that, "Our country's Founders established the First Amendment's guarantee of a free press as a recognition that a government unaccountable to public discourse renders that essential element of democracy -- the vote -- meaningless." He is correct as well.
But if the Fourth Circuit's opinion was indeed a terrible precedent, it was a precedent required by precedent. In Branzburg, the court stated that it could not "seriously entertain the notion that the First Amendment protects a newsman's agreement to conceal the criminal conduct of his source, or evidence thereof ..."
Since then, despite having the opportunity to do so, Congress has not passed a reporter's privilege or shield. The Supreme Court has not reversed course. The Fourth Circuit can't disregard decades of precedent, and their own case, LaRouche v. National Broadcasting, recognized a reporter's privilege that applies only in civil cases, as their reading of Branzburg was that the "compelling interest" requirement was rejected in criminal cases.
According to the ACLU, a fix may be in the works. The Free Flow of Information Act of 2013 is presently being considered by Congress. If passed, it would provide the much needed reporter's shield, and would null the holding of Branzburg and its progeny. The Fourth Circuit's majority opinion called on Congress or the Supreme Court to unbind their hands. This bill could be exactly what they, the dissent, and the media have been waiting decades for.