To expand on pattylou's comment:
Cosmic rays are ionising radiation. They will ionise water molecules, which in turn will generate free radicals. The free radicals, in turn, can damage DNA by
a) breaking the backbone of the helix
b) modifying bases
c) removing bases
Clearly, then, cosmic rays have contributed to the generation of mutations, some of which will have been beneficial and will have produced a fitter organism. I suspect that the overall contribution of cosmic rays in generating useful mutations is small.
I am not sure if selfAdjoint is heading there, but the radiation resistance of many bacteria has been used as evidence for pan spermia.