Earlier, Cook had made a battling 52 for the visitors but Essex lost 8-69 as they were bowled out for 129, with Roelof van der Merwe taking 3-26.
Neil Wagner then took 6-48 as the hosts faltered, but Jack Leach and Craig Overton's 50-run last-wicket stand propelled Somerset to 174 all out.
Cook and Nick Browne survived a testing seven overs as Essex closed on 10-0.
Left-hander Cook resumed his first innings on 39 and looked uneasy at the crease as he slashed at a ball from spinner Leach, sending it just wide of Lewis Gregory at first slip.
A misfield allowed the 32-year-old to scamper through for his half-century, which came off 85 balls with nine fours, but was bowled via an inside edge shortly afterwards by Gregory.
Somerset's young English quartet of Craig and Jamie Overton, Leach and Gregory all impressed with the ball as the away side were bundled out still trailing by 80 runs.
Following lunch, Wagner collected his maiden five-wicket haul for Essex as he attacked the Somerset batsmen's off stump.
However, Leach (27 not out) and Craig Overton (22) put the home side in a commanding position on a spinning pitch, leaving Cook and his Essex team-mates a tough task ahead to secure a win on day three.
Former England captain Alastair Cook will resume unbeaten on four as Essex chase 255 to beat Somerset at Taunton.