The Earth and the Sun has magnetic fields which shields us from cosmic rays, as a charged cosmic ray particle will loose kinetic energy when its direction is perpendicular to the magnetic field. So what happens to the kinetic energy of the cosmic ray particle? According to the first law of thermodynamics it can't just disappear.
It goes to the magnetic field.
According to electro-mechanics it will induce an electric current. The particles also get a spiral motion and can induce a magnetic field like a current in a solenoid. Some radiation due to breaking of the particle (bremsstrahlung) may also occur.
Yes, cosmic rays can generate a current and therefore a magnetic field (this is the idea behind magnetic field amplification (cf. this paper by M Bruggen (arXiv)). But note that roughly 90% of the cosmic rays we observe are protons which cannot generate bremsstrahlung radiation, it is the electrons that do this (roughly 9% of the cosmic rays).
The vast magnetic field of our sun is bombarded with cosmic rays with far bigger energy intensity than the cosmic rays that hit our shielded Earth. On Earth the most energetic cosmic ray observed is a subatomic particle with kinetic energy equal to that of a baseball (5 ounces or 142 grams) traveling at about 100 kilometers per hour (60 mph).
Do you have any sources for this claim in bold? We've seen some $\sim10^{18}$ eV cosmic rays on earth, which is pretty big. The largest one we've seen, which you mention, had an energy of $3\times10^{20}$ eV which is just insanely massive. We don't have great statistics in the ultra-high energy regime ($10^{15}$ eV and larger) because we get one particle per square-kilometer per century in that regime (fortunately we've had a fair number of square-kilometer arrays for a good many years, so we do have some).
So I wonder if its a possibility that the Sun is partly powered by cosmic rays?
The sun is powered by the active nuclear fusion (hydrogen burning) in its core. Cosmic rays are (theorized to be) produced in magnetic reconnection events on the sun's surface.
How large can the total cosmic ray energy hitting the heliosphere be and where does the energy go?
I would imagine that the largest energy cosmic ray that would hit the sun would be around the same as ours on earth. This energy would go into the sun. Note, though, that the sun produces roughly $10^{45}$ eV in energy per second through hydrogen fusion; adding $10^{20}$ eV is completely insignificant.