Oceans are home to much of the world's biodiversity, but we know little about the processes driving speciation in marine ecosystems with few geographical barriers to gene flow. Ecological speciation resulting from divergent natural selection between ecological niches can occur in the face of gene flow. Sister species in the young and ecologically diverse rockfish genus Sebastes coexist in the northeast Pacific, implying that speciation may not require geographical isolation. Here, I use a novel phylogenetic comparative analysis to show that rockfish speciation is instead associated with divergence in habitat depth and depth-associated morphology, consistent with models of parapatric speciation. Using the same analysis, I find no support for alternative hypotheses that speciation involves divergence in diet or life history, or that speciation involves geographic isolation by latitude. These findings support the hypothesis that rockfishes undergo ecological speciation on an environmental gradient.