In January of 2013 NASA was notified of the discovery of comet C/2013 A1 Siding Spring passing by Jupiter thanks to the Uppsala Schmidt Telescope in New South Wales, Australia. The comet is expected to come within 82,000 miles of Mars by October and has NASA scientists preparing for the event.
Three of NASA's Mars orbiters could potentially be in danger because when the comet whizzes by Mars it will shed material traveling at about 35 miles per second in all directions, which can significantly damage a spacecraft. Two of NASA's Mars explorers - the Mars Reconnaissance Orbiter (MRO) and Mars Odyssey orbiter - are currently at the Red Planet while NASA's Mars Atmosphere and Volatile Evolution (MAVEN) spacecraft is expected to arrive in September. All three will need to undergo orbit-adjustment maneuvers.
The MRO was given a maneuver on July 2 and it will receive another on August 27 to complete its repositioning in preparation for the comet flyby expected on October 19. NASA's Mars Odyssey orbiter will undergo a maneuver on August 5 and MAVEN will receive one on October 9 (a few weeks after its September 21 arrival into Mars' orbit). The teams operating each of the orbiters are ensuring each spacecraft is on the opposite side of Mars when comet C/2013 A1 Siding Spring passes by.
"Three expert teams have modeled this comet for NASA and provided forecasts for its flyby of Mars," explained Rich Zurek, chief scientist for the Mars Exploration Program at NASA's Jet Propulsion Laboratory (JPL), in this NASA news release. "The hazard is not an impact of the comet nucleus, but the trail of debris coming from it. Using constraints provided by Earth-based observations, the modeling results indicate that the hazard is not as great as first anticipated. Mars will be right at the edge of the debris cloud, so it might encounter some of the particles -- or it might not."
As for the rovers NASA deployed on Mars for on-site exploration, scientists say Mars' atmosphere is thick enough to protect its surface from being affected by debris. NASA expects the Curiosity and Opportunity rovers to be safe and they hope their cameras will be capable of observing the details of the comet flyby. But as of now, NASA will use the comet data provided by the University of Maryland in College Park, the Planetary Science Institute in Tucson, Arizona, and the Jet Propulsion Laboratory to determine how to protect their Mars spacecraft.
You can read more about comet C/2013 A1 Siding Spring's flyby of Mars in this NASA news release.