Source of variation for sure. Selection? Dunno, but there are bacteria that can thrive in radiation 10,000 times as strong as what would kill half the humans exposed to it. And there are no such sources known in nature on Earth at present, so maybe.
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.