Open Question: SF Bay Towns / Neighborhoods...?

I'm considering moving out to the SF Bay area. The problem is I'm looking to rent a 2 / 3 bedroom apartment, for under $1500 (hopefully much cheaper if possible). I want it to be in a nice neighborhood with little risk of crime and be fairly close to SF (maybe a 30 minute drive max, or on the BART or something). Anyone have any suggestions of where to look? Also, more importantly - what neighborhoods and towns are best to stay away from? I don't know the area at all so I don't know what shady areas to stay away from...