In order to make gas legal to sell in CA, it requires a special formulation and additives. Refineries have to be specially configured to produce it, so CA will almost always be more due to the smaller amount of refinery capacity dedicated to producing it. And that isn't even taking into account the various CA taxes and fees on gas that add up to nearly 50 cents a gallon.
Prices in my nearby Costco stores are $3.09 and $3.05. The highest price I've seen in my general area is $3.75. If you drive around a lot it might be worth considering a subscription to Costco; depending on your usage it might pay for itself pretty quickly.
CA is an odd duck both because of its taxes and regulations, and because the oil produces in middle America do not flow by pipeline there. So CA pays the higher international price for their crude oil.