Unicellular algae, termed phytoplankton, greatly impact the marine environment by serving as the basis of marine food webs and by playing central roles in biogeochemical cycling of elements. The interactions between phytoplankton and heterotrophic bacteria affect the fitness of both partners. It is becoming increasingly recognized that metabolic exchange determines the nature of such interactions, but the underlying molecular mechanisms remain underexplored. Here, we investigated the molecular and metabolic basis for the bacterial lifestyle switch, from coexistence to pathogenicity, in Sulfitobacter D7 during its interaction with Emiliania huxleyi, a cosmopolitan bloom-forming phytoplankter. To unravel the bacterial lifestyle switch, we profiled bacterial transcriptomes in response to infochemicals derived from algae in exponential and stationary growth, which induced the Sulfitobacter D7 coexistence and pathogenicity lifestyles, respectively. We found that algal dimethylsulfoniopropionate (DMSP) was a pivotal signaling molecule that mediated the transition between the lifestyles. However, the coexisting and pathogenic lifestyles were evident only in the presence of additional algal metabolites. In the pathogenic mode, Sulfitobacter D7 upregulated flagellar motility and many transport systems, presumably to maximize assimilation of E. huxleyi-derived metabolites released by algal cells upon cell death. Specifically, we discovered that algae-produced benzoate promoted the growth of Sulfitobacter D7, and negated the DMSP-inducing lifestyle switch to pathogenicity, demonstrating that benzoate is important for maintaining the coexistence of algae and bacteria. We propose that bacteria can sense the physiological status of the algal host through changes in the metabolic composition, which will determine the bacterial lifestyle during the interactions.