New 2-wire cable is run from the receptacle to the new light fixture. At the receptacle the wires are removed and each one is spliced to the new cable and back to the receptacle with a pigtail splice. At the light fixture box the black wire connects to the hot terminal, the white connects to the neutral terminal and the ground to any metal grounding terminal on the fixture, outlet box, or both.
The white wire on the switch loop is used to carry current from the source to the switch and it is marked with black tape or paint to label it as hot. The black on the switch loop runs from the top switch terminal to the top half of the receptacle. With this arrangement the top half of the duplex is controlled with the switch and the bottom half is always hot.
This circuit diagram shows the wiring for a new receptacle outlet connected at a light fixture. The source at the fixture is always hot and a switch loop controls the light. New 2-wire cable runs from the fixture box to the new receptacle and the source hot, neutral, and ground are splice to it along with a pigtail back to the fixture circuit. With this arrangement the new receptacle is always hot.
These sockets have two terminals, one for the hot wire and one for the neutral. A third contact may be present but is not used for this circuit. This diagram illustrates wiring for a standard, one setting lamp. This socket has two terminals, the brass for hot and the silver for the neutral wire.