Environmental transitions, such as the salinity divide separating marine and fresh waters, shape biodiversity over both shallow and deep timescales, opening up new niches and creating opportunities for accelerated speciation and adaptive radiation. Understanding the genetics of environmental adaptation is central to understanding how organisms colonise and subsequently diversify in new habitats. We used time-resolved transcriptomics to contrast the hyposalinity stress responses of two diatoms. Skeletonema marinoi has deep marine ancestry but has recently invaded brackish waters. Cyclotella cryptica has deep freshwater ancestry and can withstand a much broader salinity range. Skeletonema marinoi is less adept at mitigating even mild salinity stress compared to Cyclotella cryptica, which has distinct mechanisms for rapid mitigation of hyposaline stress and long-term growth in low salinity. We show that the cellular mechanisms underlying low salinity tolerance, which has allowed diversification across freshwater habitats worldwide, includes elements that are both conserved and variable across the diatom lineage. The balance between ancestral and lineage-specific environmental responses in phytoplankton have shaped marine-freshwater transitions on evolutionary timescales and, on contemporary timescales, will affect which lineages survive and adapt to changing ocean conditions.