SOMA is the expensive part of SF, rent wise.
Your other option is to live close to 24th st BART station. It's not close to SOMA but it takes 10-15 minutes to get to Powell or Montgomery stations and another 5-20 minutes walking to any place in SOMA (depending where it is exactly). BART runs very frequently (every 15min on weekdays) so you don't wait more than a few minutes on average.
I did such commute for a few months (from 16th/mission BART stop to an office close to 4th/king st in SOMA) and it was about 35mins.
I suggest 24th st rather than 16st as I assume that part of the town is cheaper but you can look anywhere along BART (personally I live close to 16th/mission and fully recommend that neighborhood).