Who says getting in shape has to be all work and no play? Exercise shindigs are blurring the line between fun and fitness.

Courtesty of Establishments My birthday parties have always involved a lively mix of great friends and good wine. Problem was, I'd wake the next day feeling not so much a year older as 100 years older. So when I turned 40, I switched things up: Rather than stay out obscenely late, my pals and I met obscenely early to celebrate at a workout party. Turns out, I'm not the first to turn a sweat session into a social affair.

A growing number of gyms and exercise studios are offering party-like classes to meet the demand of women like me, who want to fuse friend time and fitness in the name of marking a special occasion—or just the end of a long week. In the past year alone, Equinox Fitness Club nationwide added the festive classes Mix 'n' Ride and Monster Cycle; SoulCycle, a spinning studio in Los Angeles and New York City, holds 10 spin parties a month (up from one two years ago); and Houston-based Nightclub Cardio, which opened in 2010 with two instructors and about 30 attendees, now has 200 instructors who teach 50 classes a week at 20-plus locations. Unlike regular classes, fitness parties often include DJs and postexercise mocktails (if not actual cocktails).

What may sound like "exercise lite" is just the opposite. "People work harder because they're feeding off the energy," says Jessica Matthews, an exercise physiologist with the American Council on Exercise in San Diego. (In fact, you can burn 600 to 1,000 cals at a boot camp or spin party.) The atmosphere may also help with commitment. A recent Oxford study found that group exercise releases a flood of pleasure-inducing chemicals in the brain, increasing our pain threshold so we want to continue working out.

Health's contributing fitness editor Kristin McGee didn't need a study to know that. McGee, who teaches yoga and Pilates in New York City, fields a growing number of requests for yoga birthday parties, including Tina Fey's 40th two years ago. "I made a playlist that started with 'Birthday' by the Beatles," McGee says.

As for my own 40th, the surprise was discovering I still had trouble getting out of bed the next morning. But this time, thankfully, it was my glutes that were screaming—not my head.