Prickly Phlox, also known as Granite Gilia (Leptdactylon pungens) grows on open rocky slopes in mixed coniferous forest, subalpine forest and alpine zones.
References:
Karen Wiese, Sierra Nevada Wildflowers, p. 157, for a good picture.
Audubon Society, Field Guide to Wildflowers, Western Region, p. 671 though the Audubon picture doesn't look anything like this.