Remove the lid from the mason jar and set the jar aside. Drill a hole 1 inch wide through the center of the lid. Sandpaper the edges, if desired, to smooth the surface and remove any jagged texture.
Slip the plug of the electrical cord through the hole in the lid. Pull the cord all the way through until the light socket is against the inside of the hole.
Place a lightbulb of the appropriate wattage into the socket and screw it in. Screw the lid onto the mason jar to enclose the lightbulb. Double-check that the lightbulb is not touching the glass of the jar and switch to a different bulb style if necessary.
Secure a hook-eye screw in the ceiling over the area where you want the jar to hang. Secure a second screw into the ceiling next to the wall above the outlet you will use.
Hold the jar at the desired height and run the cord through the hook of the screw above it. Draw the cord through the second hook in the ceiling near the wall and run it down to the outlet to plug it in.