Adaptive differentiation is poorly understood in marine systems. Here, the authors combine genome sequencing with gene expression and physiology to show that genetic divergence and plasticity contribute to local adaptation of Pacific oyster populations.