A fast-moving comet is about to shave by Mars for a once-in-a-million-years encounter that a flurry of spacecraft around the Red Planet hope to capture and photograph, NASA said.