Neutral cometary atmospheres. I - An average random walk model for photodissociation in comets