Typically, you use [u]standoffs[/u]. If you need insulation, you can get nylon standoffs & nylon nuts & bolts. (Of course, you have to drill holes in the box.)
I've heard about people cutting-up a [u]BIC pen[/u] to make a standoff, and running a small machine bold all they way through.
Or if it's a plastic box, you can usually just bolt the board to the bottom of the box, as long as you don't tighten the screws too tight and bend the board. Then if you are worried about the screws comming loose, you can use some loctite or hot glue.
A couple of times, I've used some [u]Foam Insulation Tape[/u] and super glue as a quick-and-dirty solution... But I'm not recommending that.