On checking I have found I was wrong. If the power comes into the light and then a switch you need a three wire running from that switch to the other.
in the 1st box white from the light goes to screw thats marked common, black is connected to black going to other box. the other white goes to silver screw and red goes to copper screw
In th 2nd box black goes to common screw, red to copper and white to silver.
I hope this helps.