Stability of spherically symmetric solutions in modified theories of gravity