James Franco is acting like he's never acted before -- in a gay porn thriller!

The studly actor appears in the jaw-dropping, racy film, aptly titled King Cobra, which he also produced.

In the movie, Franco plays Joe, an adult-film producer who is trying to lure away gay porn star Brent Corrigan (Garrett Clayton) away a rival X-rated producer, played by Christian Slater.

In the steamy trailer, Franco and Clayton got freaky with each other and other guys in shirtless scene after shirtless scene.

The movie is based on the real-life murder of gay porn producer Bryan Kocis, who is played by Christian Slater. The film also stars Molly Ringwald and Alicia Silverstone. King Cobra hits theaters Friday, October 21.