Three options come to mind:
1) lay atop the bed and peer over from the edge. If there's a "bad guy" under there, he won't know what direction you're coming from (since he can't see your feet), so chances are two in three (with headboard to wall) you'll see him before he sees you. Also, if he's armed, it's very difficult to launch a shot vertically, since there is usually very little room to maneuver underneath beds.
2)- In the past I have dropped to a "push up" position as from the the bed as possible to grab a quick peek. The advantage here is you can usually spring up faster than if you're down on one of two knees, and if you practice it, you can drop down quickly, perhaps quickly enough to surprise any perp.
3) let the dogs in the bedroom first. You can believe that if there's someone under a bed, any ol' mutt will sniff him out.
Or you can just roll a flashbang under there
and see if someone yells "ouch".
ACP