In most cases, I wouldn't recommend that you install a ceiling light fixture without a junction box, but for some applications, it does allow the job to be completed a little easier and a little faster. The primary difference is that you will have to use a light fixture that has an enclosed back. You should never install an open-backed light fixture without a junction box. So, if you have a closed-back light fixture and you want a quick and easy way to install it to your ceiling, here's how.
Look on the back side of the light fixture to determine if there is a knockout hole available or if you will have to drill one.
Disassemble the light fixture and knock out the knockout or drill the access hole using a 3/4-inch hole saw.
Measure out the ceiling to determine where you are going to be installing the light fixture. Mark the point with your pencil and use a stud finder to ensure that you are not installing it over a stud. Make sure that you disconnect electrical power to the room before continuing.
Make a small hole in the ceiling using a hammer.
Use the wire-pulling fish to help you get the feed wire to the hole you just opened up. Make sure the wire is not live at the time. The feed wire is the cable that is delivering power to the light from the switch. If there is no existing switch, then you will have to install a new circuit to the room or tie into an existing one.
Take the Romex connector and slide it over the cable once you have it coming out of the ceiling hole. Leave about 8 to 12 inches of cable coming out of the clamp. Remove the locknut from the connector.
Strip away the outer sheath from the length of cable coming out of the connector. Cut away the sheath and any paper insulation included.
Insert the wires through the access hole on the back side of the light fixture and hold the fixture to the ceiling. Mark with a pencil where you will be installing the toggle bolts. Then, remove the fixture and set it down.
Use a screwdriver and the hammer to make holes just big enough for the toggles to fit through (but don't insert them yet).
Insert the bolt end of the toggle bolts going from the inside of the fixture through the back and then screw the toggle component about halfway down the length of the threads.
Lift the light fixture, insert the wires back through the access hole and slide the toggle bolts up into the holes you made for them. Once they open up inside the ceiling, you can let go of the fixture.
Slide the locknut over the wires and use it to secure the Romex connector to the light fixture. Then, tighten the toggle bolts until the light fixture is secure against the ceiling.
Cut any excess wire away and strip about 3/4 inch of insulation from the ends of each wire.
Connect the black ceiling wire with the black fixture wire, the white ceiling wire to the white fixture wire and the ground ceiling wire either to the fixture's ground wire or directly to the fixture's ground screw.
Reassemble the fixture and insert the bulbs and cover lens.
Restore power to the circuit and hit the switch.
Always turn the power off to whatever circuit you are working on.