Wiring a Switch, Light First
As in the last example we are working here at the end of the circuit. The source of the the circuit in our diagram is coming up from the bottom. The white wire is attached directly to the white wire on the light, while the "hot" black wire is attached to the white wire (painted or marked black with electrical tape) coming from the switch.
If the electrical box is made of metal a groundwire can be be led from the ground screw to a "pig tail" where the ground wire from the source as well as from the switch should be brought together with a screw on cap. With screw on caps different sizes accomodate more or fewer wires. Generally a blue cap will hold two or more small gauge wires, while a yellow will connect two standard sized (14 or 12 gauge) Romex wires. You will want to use red for more than two wires.
When stripping wires try not to strip off too much of the insulation to avoid shorts occuring from bare wires touching. If there looks to be any possibility of this happening, be sure to cover exposed copper wire with electrical tape.
At the switch box the black wire should be led to the top connector on the switch. The white wire, marked black to indicate that it is a "hot" wire should be connected to the lower connector on the switch. Note how the electricity is routed into the bottom part of the switch then out the top part of the switch, to the light and then out the white wire from the light.