Electrical – How to install a flush ceiling light with a poorly placed hole

electricallight-fixturelighting

I just removed a very old and broken florescent lighting fixture and was hoping to replace it with a flush LED fixture. This is what I found after I removed the old lighting:

enter image description here

As you can see, the hole landed right on a floor joist at an intersection. I am fairly new to electrical work and have not encountered a fixture without an electrical box. What is the recommend way of handling this? Should I put a box on the side of the joist and then find an alternate way of mounting the light?

EDIT:

Just wanted to share the solution I used given below as the correct answer. A shallow pan box. Not sure if this is ceiling fan safe or not, but I am just putting up a light, so I think this will work good. 4 holes were provided, but I believe just to make it easier to hit the joist. I would have used all 4 for extra weight, but hit a nail.

enter image description here

Best Answer

IMHO, (but that's opinion, and everybody has one...) the quick and easy fix for this half-fast (not up to code) job is to mount a round box in the hole and use a fixture or trim ring that hides the protruding box. And then look at the rest of the wiring, becasue it's probably not the only code violation.

Otherwise, for a better fix, patch the hole and put a new hole in a better place, then have fun matching the ceiling texture job - not that it's impossible, just that it's one of those things that's out of most people's comfort zone, but really you should actually have fun with it. Play with mud until you can make that sort of pattern and have at it. Don't be afraid to make a big hole to work in - if you're patching 4 inches of textured drywall, 4 square feet is barely a blip more effort, and it gives you the opportunity to use "new work" rather than "old work" fixtures/boxes.