Cosmic rays are energetic particles (not actually rays) traveling rapidly through space. They are everywhere, and several dozen slam into your body every second. These cosmic rays are too low-energy to cause any serious health effects, aside from a few genetic mutations, and cosmic rays are in fact one of the drivers of evolution. Your body receives about 2.4 mSv (milliSieverts) of radiation caused by the effects of cosmic rays every year. For comparison, it takes about 1 Sievert of radiation in a short time to cause nausea, and about 2-6 Sieverts to cause death.
The health effects of cosmic rays change at higher altitudes, where the cosmic ray flux increases exponentially up to an altitude of about 15 km (9 mi), then drops off rapidly. Because of this, people who spend a lot of time at high altitudes, like airline pilots, stewardesses, and Air Force test pilots, experience dozens of times the effects of cosmic rays that people on the ground do. This is still well below the career limit of 1-4 Sv recommended by the National Council on Radiation Protection and Measurements. The cosmic ray flux is low enough in the Earth's atmosphere that exposure only becomes an issue in space.
On the International Space Station, 350 km (217 mi) above the surface of the Earth, astronauts experience the effects of cosmic rays hundreds of times more numerous than those experienced by people on the ground. The Earth's atmosphere is such an effective insulator that barely any particles actually make it to the ground, and most of what people are exposed to is secondary radiation from collisions in the upper atmosphere. On space stations, astronauts are exposed to primary radiation. However, people have spent more than a year in space with no ill effects from cosmic rays, and it seems plausible that indefinitely long stays are possible.
The people who would be most exposed to cosmic rays are people journeying between the Earth and the Moon or the Earth and other planets. The Earth is primarily shielded by its magnetosphere, a huge magnetic field that extends about 70,000 km (43,500 mi) from the Earth's surface in every direction. Leave the magnetosphere, and you are exposed to galactic cosmic rays -- one of the strongest types -- which are typically blocked by the Earth's magnetic shielding. Accordingly, Apollo astronauts reported seeing flashes of light in their eyeballs, which may have been galactic cosmic rays. The effects of prolonged exposure to these rays -- say, on a Mars mission -- are unknown.