Here's how to legally grow in CA: First, you have to be a resident of CA, then go to a doctor who gives the recommendations for medical marijuana (they're not hard to find, check out the website for CA NORML, or ads in the marijuana publications), then go to one of the dispensaries and become a member of their collective. Usually, just show up with your recommendation and CA ID and that's how you join. Then ask them if they want the stuff you grow. If they don't or if they won't give you enough to pay for your growing it, keep going to other collectives ( there's no limit on how many you can join) until you find some who want your stuff at a fair price. I agree that most of the dispensaries pay growers less than half what they charge their members, and it is a ripoff. But, there is money to be made by the growers, and usually you don't have to worry about being arrested, the dispensary operators do. There's an upside to everything.
And, the local "authorities" are starting to raid dispensaries because they're not having members grow for the collective, they've been buying from commercial growers. That means if the dispensaries want to stay open in the future, they need growers like you. You can help them stay legal.