Make sure you turn off the power at the power panel.
If you are lucky you will find the following in the electrical box behind the light:
- A black wire that brings power from the fuse/breaker panel--connected directly to one or two other (black) wires (not to the light).
- A white wire from the panel--connected to one or more white wires including one to the light.
- A black or white (maybe taped black) wire that comes from the switch and is connected to the light.
- A green or bare wire connected to the box and maybe also to the light.
If this is the case then you can run a new cable to a new electrical box in the wall for the GFI. Connect the new black wire to the Line In terminal/black wire of the GFI outlet and to the group of black wires in (1) above. Connect the new white wire to the Neutral terminal/white wire of the GFI outlet and to the group of white wires in (2) above. Connect the new green/bare wire to the Ground terminal/green wire of the GFI outlet and to the original box or ground wire. If there is a Load/Feed through wire on the GFI outlet, tape the end of it and do not use.
If the black and white wires described in (1) and (2) above do not appear in the electrical box at the light then they are probably in the switch box and there will be only one black wire and one white wire that connect to the light on the wall. In that case you will need to run a new cable from the switch box to the new outlet. You will not be able to wire the new outlet from the existing electrical box at the light unless you do it through the switch and it will not be on unless the switch is on.