See also: correlation between sea level rise and solar activity
The picture above shows the number of sunspots in the past. Note that there is a natural 11-year-long cycle and this basic solar variation cycle is modulated by a signal whose timescale is comparable to 400 years. Note the Maunder minimum - click the picture to learn more about it - during 1650-1700. It happens to kind of agree with the coldest years of the Little Ice Age. Also, the number of sunspots in recent years reached the 1000-year high.
Commercial: Nigel Worthington's notes on climate change (click)Click the picture below to zoom it in.
At longer, geological timescales, there seems to be a rather impressive inverse correlation between the number of cosmic rays and the temperature. The more cosmic rays, the more clouds they help to create, and the cooler temperatures you get. Lower clouds have a cooling effect while high clouds have a warming effect.
Click the figure below - from a paper by Shaviv and Veizer - to get much more information about it from Nir Shaviv's website.
The graph above shows a period of 140 million years or so. In fact, all kinds of geophysical and astronomical records indicate that the period was around 140 million years and the coldest moment of the cycle appeared in 70% of each cycle. This fact, captured by the picture below, shows that the cosmic-climate link is rather robust:
A paper by Svensmark and Friis-Christensen - click the graph below to see the full article in PDF - shows a close correlation between the cloud cover (thick line in the middle of the range) and cosmic ray flux in Climax, Colorado (thin line):
The thick line doesn't continue to the present and you may ask whether the agreement continued to hold. Here is the updated graph of the same correlation from Shaviv 2005:
It is useful to know that a lot of changes have been taking place in the Sun. For example, the Sun's coronal magnetic field has doubled in the last 100 years, see e.g. Lockwood et al.