First off you should hire a car, it's cheap and so is petrol out there. I caught a greyhound bus to merced with a view to getting a shuttle bus to Yosemite and ended up spending a night in fresno and hitch-hiking the rest of the way.
If you're closer to San Francisco then do Yosemite. Closer to LA then Joshua Tree is nearer.
My vote would be for Yosemite if you've never been. You won't believe your eyes when you first see El Cap.
\"When you look into the abyss, the abyss also looks into you\". - Oom Nietzsche