Recent observations with the Submillimeter Wave Astronomy Satellite (SWAS)
indicate abundances of gaseous H2O and O-2 in dense molecular clouds that a
re significantly lower than those found in standard homogeneous chemistry m
odels. We present here results for the thermal and chemical balance of inho
mogeneous molecular clouds exposed to ultraviolet radiation in which the ab
undances of H2O and O-2 are computed for various density distributions, rad
iation field strengths, and geometries. It is found that an inhomogeneous d
ensity distribution lowers the column densities of H2O and O-2 compared wit
h the homogeneous case by more than an order of magnitude at the same A(nu)
. O-2 is particularly sensitive to the penetrating ultraviolet radiation, m
ore so than H2O. The S140 and rho Ophiuchi clouds are studied as relevant t
est cases of star-forming and quiescent regions. The SWAS results of S140 c
an be accommodated naturally in a clumpy model with a mean density of 2 x 1
0 cm(-3) and an enhancement of I-UV = 140 compared with the average interst
ellar radiation field, in agreement with observations of [C I] and (CO)-C-1
3 of this cloud. Additional radiative transfer computations suggest that th
is diffuse H2O component is warm, similar to 60- 90 K, and can account for
the bulk of the 1(10) -1(01) line emission observed by SWAS. The rho Oph mo
del yields consistent O-2 abundances but too much H2O, even for, [C]/[O] =
0.94, if I-UV < 10 (respectively <40) for a mean density of 10(3) (respecti
vely 10(4) cm(-3)). It is concluded that enhanced photodissociation in clum
py regions can explain the low H2O and O-2 abundances and emissivities foun
d in the large SWAS beam for extended molecular clouds but that additional
freezeout of oxygen onto grains is needed in dense cold cores.