Cameron Diaz, Jason Segel Make 'Sex Tape' in First Red Band Trailer (Video)

The "Bad Teacher" co-stars reunite in Columbia's R-rated summer comedy, about a married couple whose sex tape accidentally becomes public.

Jason Segel and Cameron Diaz are getting raunchy in the bedroom.

The R-rated comedy Sex Tape follows a married couple (Segel and Diaz) who wake up to discover that the video they made the evening before has become public, leading them on a frantic search to figure out how to undo the mess.

As the first red-band trailer opens, Segel and Diaz -- who previously starred together in 2011's Bad Teacher -- play characters in a marital rut, the spark gone from their relationship. How do they reignite it? By making a sex tape, of course. Things get complicated when the tape is accidentally synced up to the cloud, allowing other people to access it via iPads the couple had gifted to friends, family and co-workers. Desperation starts to wear on them, to say the least.

PHOTOS: Behind Closed Doors: A History of Sex on TV

"It went up to the cloud!" "And you can't get it down from the cloud?" "Nobody understands the cloud! It's a f---ing mystery!"

Sex Tape reunites Segel and Diaz with Bad Teacher's Jake Kasdan, who directed the film from a script by Kate Angelo. Rob Corddry, Ellie Kemper, Jack Black and Rob Lowe also star in the Columbia Pictures comedy.

Sex Tape hits theaters July 25.