Cosmic rays are an "electromagnetic" effect?
Yes. Electromagnetic radiation is light (visible, infrared and ultraviolet), radio waves, microwaves, x-rays, gamma rays (the last two when extraterrestrial in origin are part of "cosmic rays") and the charged-particle part of cosmic rays are influenced by the earth's and sun's magnetic fields.
Tying the Black Death to the atmospheric effects of cosmic rays is a dubious proposition, but modulation of the atmospheric effects of cosmic rays by the sun's magnetic field is the best suggestion for the mechanism that makes solar minimums (minimum in the sense of minimal magnetic activity, as evidenced by sunspots) coincide with colder climate periods on earth. And yes, that's an electromagnetic effect.