Best Option For Securing Lightbox
The electrical box in the ceiling should not be able to come through the hole under any circumstances.  If this one is, then it's probably a box that was not designed to support a fixture.    (You didn't mention what kind of fixture was in this room before, but there are several types of lamps which don't hang directly from a box -- fluorescent fixtures, and "swag"-style lamps of the 1960s and '70s are popular examples).

Unfortunately, your choices are two:

(1) Get an "old work" box that's rated to support a hanging fixture.

An "old work" box is one that installs into a ceiling after the house is built (i.e., now), while a "new work" box is one that is installed while building the house (i.e., before the ceiling is installed).

For the kind of lighting fixture you have, where it pulls down on the box (due to gravity),  you have no choice but to have a box that's rated to support a fixture --- typically, this must be reinforced to the ceiling structure.   A ceiling box that "clips" to the drywall or plaster ceiling relies on the strength of the ceiling, which means that if the drywall, or plaster, ceiling cracks, due to the weight of the lamp, your lamp will come crashing down.    This is a safety hazard, is prohibited by building and electrical codes, and might hurt someone.

Or:

(2) Get a different hanging lamp that doesn't hang directly from the outlet box.

There are plenty of fixtures that don't hang directly from the electrical box.   Either "strip" lighting fixtures (fluorescent-style), or "swag" style lamps are good alternatives.   


For swag lamps, you hang them elsewhere, usually from a hook that's screwed into a stud above (also known as a ceiling joist), and then only a cord goes to the electrical box.

For a fluorescent or strip lamp, you screw the lamp into the ceiling-joists through mounting holes, so the screws bear the weight and the outlet-box does not.

Occasionally, you can find a "pendant" light that has a mounting ring which provides screw holes into the ceiling.  You'll need to make sure you have something solid in the surrounding area -- a joist very close to the outlet box, for example, which it sounds like you don't have.




For each of these choices, the electrical box doesn't have to support any weight, so you'll likely be able to use an "old work" box that just clips to the existing ceiling.

Whichever you choose:

It seems like you should replace the existing box since it isn't secured well enough to the existing ceiling.  The box should never come down from the ceiling.  A good local hardware store or big-box home improvement store can sell you what you need.  If the thought of replacing the box makes you uncomfortable, you should call a professional to complete the install.