The feed wire (the hot wire coming from the service panel) runs to the switch before it goes to the fixture. Two cables enter the switch box: one supplying power and one going to the fixture.