“Space weather” refers to electromagnetic and particle conditions in space near the Earth that may produce problems for spaceborne and ground-based technological systems, and which may even be dangerous to humans. Explosions on the Sun are the primary origin of space weather phenomena. The solar wind carries the effect to the Earth, and the interaction with the geomagnetic field affects the magnetosphere, which has a sharp boundary on the dayside and a long tail in the nightside. The plasmaphysical coupling between the magnetosphere and the ionosphere is also important. The entire chain, starting from the Sun and ending at geomagnetic storms observed at the Earth's surface, involves complicated processes whose better understanding will lead to possibilities of avoiding harmful impacts. In space weather research, galactic cosmic rays have to be considered as a secondary source.