The crash occurred around 10:30 a.m. on Interstate 80 near Davis, which is about 15 miles west of Sacramento.
The tractor-trailer driver was in the eastbound lanes when he lost consciousness, drifted onto the right shoulder and then veered sharply to the left, going across the highway and over the center divider, California Highway Patrol Officer Chris Parker said.
He regained consciousness, but not in time to avoid an oncoming BMW. The vehicles collided head-on and burst into flames.
The driver of the BMW and a second person in the vehicle died, said Deputy Tenzin Dorji of the Solano County Coroner's Office.
The truck driver suffered minor to moderate injuries, including burns, Parker said. He also collided with two other vehicles as his truck went across the highway, leaving two others with minor to moderate injuries.
Authorities haven't released the identities of the truck driver or the BMW driver.
The highway was shut down in both directions for hours, but the eastbound lanes were reopened by early afternoon, Parker said.