The easiest way is to do:
chmod -R u+rwX,go+rX,go-w /foo
which basically means:
to
ch
ange file mod
es -R
ecursively by giving:u
ser:r
ead,w
rite and eX
ecute permissions,g
roup ando
ther users:r
ead and eX
ecute permissions, but not-w
rite permission.
Please note that
X
will make a directory executable, but not a file, unless it's already searchable/executable.