What are cosmic rays?
The base structure of all things is the atom. Atoms are full of movement, both internally (electrons orbiting the nucleus) and externally (interacting with other atoms). This movement creates kinetic energy that is measured in electron volts (eV). The atoms of the air we breathe move as fast as cannonballs and generate around 0.03 eV. They bounce into other atoms of air but, like bumper cars at a fairground, they don’t do much harm to each other.
Elsewhere we find atomic particles moving much faster than this, which create more heat and more energy. Electrons within the Sun’s plasma have up to 10,000 eV, and protons in the magnetosphere [*] are higher still, in the range of 10 - 100 million eV.  The atomic particles in the magnetosphere move at speeds of 400-800 kilometres per second.
This is all rather calm relative to the greater universe. Bombarding the Earth from light years away are the ions we call cosmic rays. [†] They can move close to the speed of light and can pack a walloping 50 joules of kinetic energy (3 × 1020 eV). That’s the power of a cricket ball moving at 160 km/h, packed into the size of a sub-atomic particle.
Most cosmic rays are the nuclei of atoms (protons), ranging from the lightest to the heaviest elements in the periodic table. The lightest elements are the most common, with hydrogen (89%) and helium (10%) dominating, along with other light elements (lithium, beryllium and boron). A few will be medium elements like carbon or oxygen, with heavier elements becoming less and less common. This is a similar relative abundance to the elements within our solar system. 
Who discovered them?
In 1912 Austrian-American physicist Victor Hess found that his electroscope discharged more rapidly as he ascended in a balloon. He theorised that there must have been radiation entering our atmosphere from outer space, which he dubbed cosmic rays. In 1936 he was awarded the Nobel Prize for his discovery.
Where do they come from?
Cosmic rays hit Earth from every direction, but this tells us nothing of the location of their original source. Because they are magnetically charged, any interaction with a magnetic field, even an extremely weak one, will change their path. They are constantly deflected by magnetic fields throughout the galaxy, until any clues to their origin is lost. (However, it is possible to trace cosmic rays in other regions of the galaxy by the electromagnetic radiation they produce). 
Within our local planetary system the solar wind creates a magnetic field of its own. This makes it difficult for cosmic rays to make it to Earth - there is a correlation between the peak of the sunspot cycle and fewer cosmic rays reaching Earth. 
We don’t know where all the cosmic rays come from. The Sun emits low energy cosmic rays, typically accompanying solar flares. But even if every star in the known universe created cosmic rays in a similar manner, they would only explain a fraction of them.
The majority are believed to come from supernova explosions [‡] , which occur approximately once every 50 years in our Galaxy. They either originate from the explosion itself, or are created by the shock waves interacting with the surrounding interstellar gas. This reasoning is based on the energy requirements for creating cosmic rays, with only supernovas being deemed powerful enough to make them. In both cases the ejected matter expands at supersonic velocities, accelerating nuclei from the material they pass through, transforming them into cosmic rays. 
Other sources could be neutron stars, radio galaxies, X-ray binaries (such as Cygnus X-3), active galactic nuclei (AGNs) and black holes.
To measure cosmic rays directly, before they have been slowed down and broken up by the atmosphere, particle detectors can be placed on spacecraft and high altitude balloons.  Or they can be detected indirectly on our planet’s surface. When cosmic rays collide with atoms in the upper atmosphere, they create secondary particles (pions, electrons, positrons) which shower down to the Earth, spreading out over hundreds of metres. A grid of a hundred or so detectors is used to sample this area. The more particles that are detected, the stronger the cosmic ray. The atomic number of the cosmic ray’s nucleus cannot be discovered using this technique, just statistics of size and frequency. The biggest registered so far, a 50-joule cosmic ray, was at a Utah desert observatory in October 1991. On average one of this size will enter our atmosphere every second.
The world’s biggest cosmic ray observatory is being built in Argentina and will be operational in 2004.
Cosmic rays of this size are labelled "ultra high-energy". To date, scientists have been unable to determine the limits of the cosmic-ray spectrum, simply because they lack a detector large enough. The more powerful the particle, the less common it is, and the larger a detector needs to be to spot it. So even when the galaxy is quiet, there may be much larger cosmic rays hitting Earth and going undetected.
Ultra high-energy cosmic rays are a puzzle for scientists. Astrophysicists have decided that only black holes of a billion solar masses would have the energy to create them. Because interaction with the universal microwave background (remnants of the Big Bang) causes them to lose energy, their source cannot be more than 30 million light-years away. But within our own galaxy there are no known mechanisms to create such powerful particles.  An obvious answer comes to mind that most scientists will have difficulty accepting, that something within our galaxy - that has yet to be observed - could create them.
It is understandably hard for us to recreate the conditions of the cosmos here on Earth. The most modern artificial vacuums do not come close to achieving the emptiness of space, which has a density as low as one atom per cubic centimetre. Because ultra high-energy cosmic rays move close to the speed of light, time-scale adds to the problem. If we could observe a cosmic ray for 10,000 years, from the particle’s point of view only one second will have passed  . Viewing it for a microsecond in a particle accelerator will not tell us much. The complicated electrical and magnetic fields of outer space add to the difficulties. So, even if we can estimate where cosmic rays come from, we have no idea how they are created. And the time scales are impossible to recreate. Guesses and theories abound. Definitive answers do not.
Is the rate of bombardment constant?
No. This is one reason why carbon dating (http://www.sigmaxi.org/amsci/articles/00articles/taylorcap2.html) (the carbon isotopes they measure are created by cosmic rays) is inaccurate, because it assumes that the rate is a constant, which is a typical gradualist way of looking at things. Evidence from a half-metre long stalagmite that grew between 45 000 and 11 000 years ago in a cave in the Bahamas, shows that the cosmic ray intensity for that period was double what it is today - see here or here for more info.
What happens when they hit earth?
The combined energy of all the cosmic rays approaching Earth is massive. Fortunately the atmosphere and magnetosphere [§] protect us from them as effectively as a slab of concrete four metres thick. Even so, when cosmic rays collide with atoms in the upper atmosphere, they release showers of gamma rays, X-rays and subatomic particles. Most of these secondary particles will make it to the Earth’s surface. And the most energetic fragments, although rare, are capable of penetrating miles underground. 
Atomic structures mainly consist of space - space between the nucleus and electrons, space between the individual atoms. Because of this, sub-atomic particles can travel a great distance before they collide with anything. Consequently most cosmic rays and secondary particles pass right through houses, trees, rocks, birds and humans. But a few will occasionally crash into atoms within these structures and beings. Don’t be too alarmed; this cosmic radiation is minor compared to the Earth’s natural background radiation, which in total hardly affects any of us at all anyway.
Thousands of rays and fragments pass through our bodies every minute.  Outside of the Earth’s atmosphere, where some satellites and astronauts roam, cosmic rays are very dangerous indeed - their sheer frequency means they can ionise electronic circuitry and mutate the genes of astronauts.
How dangerous is flying?
Altitude matters. Whether you are flying in an airplane or living at a high altitude such as Tibet - the amount of cosmic radiation your body must deal with is increased.
During solar radiation storms, passengers on jets flying nearer Earth's poles can get zapped with than the equivalent of 10 chest X-rays
A 1996 paper in the American Journal of Epidemiology examined the incidence of cancer among 2,740 Air Canada pilots. The group had a sharply higher incidence of four specific types of cancer compared to the general population: myeloid leukemia, astrocytoma, prostate cancer, and malignant melanoma.
- Myeloid leukemia is definitely associated with radiation exposure, and occurred in the Air Canada pilot group four times more frequently than in the general population. A Danish study also found an association between exposure to cosmic radiation and leukemia among aircrew - it was published in Lancet 1999; 354: 2029-31
- Astrocytoma (a type of brain cancer) occurred twice as often in the Air Canada pilot group as in the general population, and increased incidence has also been found in other studies of airline pilots.
- Significantly higher incidences of prostate cancer were found in both the Air Canada study and another study of British Airways pilots. Current thinking is that this might be related to electromagnetic radiation from weather radar and other avionics rather than from cosmic radiation.
- A study of female airline flight attendants in Finland and Denmark showed an increased incidence of breast cancer, and a study of male U.S. Air Force pilots showed they had significantly more genital and testicular cancer than non-flying USAF officers.
In 2000, the European Union introduced legislation which requires all European airlines to monitor cosmic radiation levels during flight and to inform aircrew of the possible health risks.
"Airline pilots, crew, and passengers definitely are hit by more cosmic radiation than someone on the ground. The radiation is stronger at higher altitudes, and especially over the poles. Individual flights are almost certainly not a problem, since the radiation will never get anywhere near the 2.5 millirem per hour maximum allowable radiation dose (OSHA) even for a 41,000 ft flight right over the poles. But it is possible that pilots and crew accumulate enough to slightly increase their cancer risk. A Finnish study showed a higher breast cancer rate for stewardesses than for non-stewardesses, but there are other environmental factors (air quality for instance) that could affect this.
The weight of shielding required to protect against this radiation would make these flights nearly impossible. So there's not really anything you can do except decide not to fly."
The invisible passenger : radiation risks for people who fly by Robert J. Barish
Time Magazine - JULY 9, 2001, VOL.158 NO.1
"Yet to become a legal issue is the worry over cosmic radiation. According to the Federal Aviation Administration, at 12,000 m air travelers are exposed to as much as 265 times the radiation dose they receive on the ground. Some airlines take pregnant female flight attendants off airborne duties to avoid exposing the fetus to cosmic rays. Passengers who make a transpolar journey, like the new direct Hong Kong-New York routes operated by Continental Airlines, United Airlines and, from September, Cathay Pacific, receive on average the equivalent to three chest X rays. (The rays concentrate around the North Pole's magnetic attraction.) Five round-trips on these flight paths would put the traveler in excess of the recommended annual limit for exposure to radiation, experts say. Already, since the flights commenced in March, Continental and United have rerouted one each, Continental citing passenger health concerns, United radio interference from solar radiation. (United said last week it was canceling its flight from next month for business reasons.) Maria Blettner, head of Germany's Radiation Protection Commission, is finishing a large-scale mortality study on cancer among flight crews, which is examining the medical history of 22,000 pilots and 50,000 flight attendants. Results are due soon, but Germany's Cockpit Association, a professional organization of pilots and engineers, warns the findings will reveal breast-cancer rates among stewardesses may be twice as high, and skin-cancer rates up to 15 times as high as those of the general populace."
Should I worry?
Although you can’t feel them, cosmic rays, and/or their secondary particles, pass through you all the time. Mostly they won’t touch the sides. But, occasionally they will connect with one of your atoms, and, if your DNA repair system doesn’t kick in, you might in some way mutate. Standard theories of Darwinian evolution always mention random mutations, but rarely point out the mechanism behind them - cosmic rays are a leading cause.
At current levels, unless you are a pregnant frequent flier, there are many, many other factors in your daily life that do you more harm. But if the level of cosmic ray bombardment increases - as it has done in the past - it might be prudent to investigate ways of shielding yourself from them.
Cosmic Ray Intensities at Major Cities Worldwide (bottom of the page)
Dosimeters - for measuring an individual’s exposure
Radiation exposure for aircrew - a big article from AVWeb
Downloadable program - allows flight crew to calculate their levels of exposure
[*] Magnetosphere: area surrounding the Earth that is influenced by its magnetic field. Towards the sun it extends for 60,000 kilometres, and away from the sun it forms a tail, created by the solar wind, with a length of one million kilometres
[†] The term “cosmic ray” is misleading. Rather than being an actual ray (a thin beam of radiant energy or particles), it is just a singular particle - anatom that was stripped of its electrons when accelerated to enormous speeds.
The cosmic rays referred to here are more properly known as Galactic Cosmic Rays. The general term can also includes subatomic particles like electrons and positrons, particles arriving from the sun and particles accelerated in interplanetary space.
[‡] A supernova is a star which has run out of the "nuclear fuel" of light elements (especially hydrogen), needed to keep it shining. Its "nuclear burning" gradually converts light elements into heavier ones, and the heat it produces keeps the star puffed up, resisting the pull of gravity which would like to draw it together. When the star can no longer produce nuclear heat, it suddenly collapses to a small volume, releasing in the process an enormous amount of gravitational energy. Much of that energy is spent in a grand explosion, blowing the star's outer layers out to space and creating a huge expanding shock front. (from a NASA website)
[§] The active sun with its large solar wind creates a large distortion of the magnetic field about the earth (the magnetosphere), which increases the earth's shielding against intragalactic cosmic rays. This leads to a net reduction of the sea-level cosmic rays during the period of the active sun. In the active sun of 1989-1991, which was the most intense solar activity ever recorded, the sea-level intensity of cosmic rays actually decreased by about 30%. Thus, the active sun greatly intensifies the solar wind, and the external particle flux increases, but the earth's distant magnetic field also increases. The final result of this complex interaction is that the terrestrial sea-level flux of cosmic particles decreases during the active sun, except for the few hours during the most spectacular solar flares (from http://www.research.ibm.com/journal/rd/421/ziegler.html)
 http://www.srl.caltech.edu/personnel/dick/cos_encyc.html, Macmillan Encyclopedia of Physics in 1996. R. A. Mewaldt, California Institute of Technology
 Macmillan Encyclopedia of Physics in 1996.
 Macmillan Encyclopedia of Physics in 1996.
 "Cosmic Rays at the Energy Frontier," Microsoft® Encarta® Encyclopedia 2000. © 1993-1999 Microsoft Corporation. All rights reserved. By James W. Cronin, Thomas K. Gaisser and Simon P. Swordy About The Authors: Cronin, a professor of physics at the University of Chicago since 1971, shared the Nobel Prize with Val L. Fitch for work on symmetry violations in the decay of mesons. Gaisser, a professor of physics at the University of Delaware. Swordy, an associate professor at Chicago, has been active in cosmic-ray measurement since 1976. He earned his Ph.D. from the University of Bristol in 1979. This article updates a version that appeared in Scientific American in January 1997.
 Macmillan Encyclopedia of Physics in 1996.
 "Cosmic Rays at the Energy Frontier," Microsoft® Encarta® Encyclopedia 2000. © 1993-1999
 Einstein’s Theory of Relativity
 Macmillan Encyclopedia of Physics in 1996.