Can you solve the 3-switches problem?

3-switches

Alex Bellos' Monday puzzle in The Guardian is the Three Switches Probem:

Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp.

The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed only one trip to the attic. How do you do it?