You covered it already—layers.
This is actually a very common technique among ultralight backpackers.
They will often intentionally bring a sleeping bag with 5-10ºF less insulation than needed and compensate by wearing all their clothing to bed.
If you need to get warm fast, you can do some sit-ups to get your blood moving.
You only need to worry about sweating if you overinsulate.
The form of insulation (sleeping bag or clothing) won't make a difference.
In fact, having more layers gives you more flexibility so you can adjust your insulation level depending on the actual conditions.
If you bring your -40 sleeping bag, you will overheat and sweat.
Source:
Common knowledge, but available in Mike Clelland's Ultralight Backpackin' Tips among other places.
outdoors.stackexchange.com/users/5594/Mitch
Aside from layering your clothes inside your bag, or layering your bag using a bag liner, it's also important to make sure you have a good ground sheet or sleeping pad that will insulate you against the ground and reflect your body heat back up.
You lose a lot of body heat into the ground while sleeping, so at the very least, using a survival blanket as a ground sheet (shiny side up) will reflect some of that heat back up.
You also lose a lot of heat through your head, so bring a toque or warm hat to wear while you sleep, this adds a surprising amount of warmth and comfort.
Eating will keep you warmer too.
Deer spend a lot of time feeding in the middle of the night when it's cold out, not because they're hungry, but because it's fuel on the fire and keeps them warmer.
Eating a good hot meal before bed will help your body generate more heat during the night.
Emptying your bladder will also help, your body wastes a lot of energy keeping a full bladder of water warm.
Tricks for warming up in the middle of the night include preparing a thermos of hot soup or hot drink just before bed, and drinking it when you wake up cold.
In the himalayas everyone carries a pee-bottle for when they have to pee in the middle of the night.
Instead of getting out of their warm bag, they'll pee inside the bottle, then keep the warm pee-bottle in their bag until morning.
Personally, I pack a warmer bag, I sleep with a -10ºC bag in the summer time, if it's warm enough out
I'll use it as a down comforter when I lay down at the end of the day, but I always end up zipped up inside it sometime during the night.
Even in the middle of summer it still dips down close to freezing at night here in the rockies.
outdoors.stackexchange.com/users/4148/ShemSeger
Several good tips have already been posted; another to consider is a hot water bottle.
I was on a trip for a mountaineering class recently and was surprised by how many people had never slept with a hot water bottle before!
Use a solid bottle which won't leak and is designed to handle high temperatures, like a Nalgene bottle.
If you're already carrying fuel and heating water to cook with, it's easy to heat a bit more and throw it in your bag before you go to sleep.
Then it'll already be nice and toasty before you get in.
outdoors.stackexchange.com/users/208/nhinkle
I would like to also recommend a sleeping pad.
They make a big difference for comfort on bumpy ground in addition to adding insulation.
I think the closed cell pads work better than the inflatable ones.
But, that's a personal choice.
outdoors.stackexchange.com/users/3028/Junco
If you are car camping,you can take both.
If not, a good down jacket that is really lightweight down.
Wear a hat to add warmth.maybe socks too.down booties are another option to stay warm.
outdoors.stackexchange.com/users/6033/user6033
I've got a winter sleeping bag rated down to -40c but its heavy and it won't get that cold where I am going. The coldest it will be is +5 to -5.   I've another lightweight sleeping bag rated 5 degrees comfort and it weighs very little. I would rather take this bag and know how to get warmer if needs be by putting on more clothes for example, but this might make me sweat..   So any best practice recommendations for how to get warmer if the temperature does drop further?
Staying warm in a lightweight sleeping bag
outdoors.stackexchange.com
<sleeping-bags><sleeping>
outdoors.stackexchange.com/questions/8360
outdoors.stackexchange.com/users/2882/Andrew Welch
Aside from layering your clothes inside your bag, or layering your bag using a bag liner, it's also important to make sure you have a good ground sheet or sleeping pad that will insulate you against the ground and reflect your body heat back up. Another thing to consider is a hot water bottle. Emptying your bladder will also help, your body wastes a lot of energy keeping a full bladder of water warm.   If you need to get warm fast, you can do some sit-ups to get your blood moving and eating will keep you warmer too. Emptying your bladder, sit-ups, eating, sleeping pads, layering and hot water bottles work well.
Sleeping pads, layering and hot water bottles work well. Emptying your bladder, sit-ups and eating all warm you up.