Effective management of threatened species requires an understanding of both the genetic connectivity among populations and adaptive population divergence. For the numerous coastal marine species with planktonic dispersal, high connectivity can obscure population boundaries and oppose the diversifying effects of natural selection through homogenizing gene flow. Using an ecologically and commercially important marine bivalve as a model system, my dissertation aimed to characterize the spatial scales of neutral and adaptive differentiation in the face of gene flow and identify candidate loci under selection. The Olympia oyster (Ostrea lurida) is native from Baja California to the central coast of Canada and distributed over strong environmental gradients. Following devastating commercial exploitation by the early 20th century, recovery of O. lurida populations has faced other anthropogenic challenges, including ocean acidification. For my dissertation, I used high-throughput sequencing, bioinformatics, and mesocosm experiments to 1) describe the neutral and adaptive population genetic structure in O. lurida, 2) characterize adaptive phenotypic variation at a local scale, and 3) evaluate molecular responses to acidification stress across genetically diverged populations in two bivalve species. Significant population structure in the Olympia oyster was observed using both neutral and putative adaptive genetic markers derived from genotype-by-sequencing of oysters across 20 sites. To determine if local adaptation can occur among populations with high inferred gene flow, I investigated genetic and phenotypic variation among three populations of oysters in Puget Sound, WA. Through a common garden experiment on oysters that had been reared for up to two generations in common conditions, I demonstrated that these three populations exhibit heritable differences in reproductive timing, larval growth rate, and juvenile growth rate. Adaptations to natural long-standing variation of ocean pH in widespread species along western North America may be informative for predicting resilience to projected conditions. Overlapping the Olympia oyster’s range, the purple-hinged rock scallop (Crassadoma gigantea) is found from southern California to the Aleutian Islands. To understand inter- and intraspecific variation in response to reduced pH, I compared gene expression responses to two pH treatments (7.4 and 7.8) in adult oysters and rock scallops from multiple genetically diverged populations. Within species, genes were identified that exhibited a conserved response to pH across populations or a significant population-specific response—the latter are considered candidate genes involved in local adaptation.