(written from a Production point of view)
Viacom, formed in 1971, was a major media conglomerate that owned such properties as Paramount Pictures (and, as such, the Star Trek movie franchise), CBS, UPN, Spike TV, Blockbuster Video, MTV, Nickelodeon, Infinity Broadcasting, and Paramount Parks, among many others. They also owned all rights to the library of Paramount Television, which includes all Star Trek television programs. Pocket Books and Simon & Schuster, publishers of the Trek novels, were incorporated into Viacom in 2002.
Viacom acquired the Star Trek franchise in 1994 when it purchased Paramount Communications. (Paramount Pictures acquired the franchise in 1967 when both it and Desilu Productions were purchased by Gulf+Western, which combined them under the Paramount Pictures name. Gulf+Western later changed its name to Paramount Communications.)
Following Viacom's split with CBS in 2005, Viacom dissolved and was re-established as the CBS Corporation. CBS acquired the rights to Paramount Television, which was subsequently merged into CBS Paramount Network Television, and to UPN, which subsequently merged with The WB to become The CW. CBS Corporation also continues to own Simon & Schuster and Paramount Parks.
Following the split, a new Viacom was founded. This company received the rights to Paramount's film division, which includes the Trek movies.