A detailed study of the absorbing molecular clouds towards the radio s
ource PKS 1413+135, at a redshift z=0.247, is reported. Physical condi
tions (density, temperature, filling factors) are derived for the mole
cular gas, in the frame work of two models: a homogeneous multicompone
nt model with equal filling factors, and a two-phase medium consisting
of dense clumps embedded in a more diffuse component. It is shown tha
t our absorption data are consistent with the presence of a diffuse ga
s component, dominating the observed opacity, and a dense component, a
ccounting for most of the mass. We also show that without knowledge of
the small scale structure of the absorbing molecular gas, we can only
derive lower limits to the column density. Given the very narrow abso
rption spectrum, the size of the overall absorbing cloud along the lin
e of sight must be quite small, of the order of Ipc. The variability o
f the absorption spectrum has been studied over a time range of more t
han 2 years. We find that the opacity ratio between two absorbing comp
onents in CO has varied by a factor 2.3 +/- 0.3. The variations are in
terpreted as a change of the line of sight due to structural changes i
n the background source. We discuss what can be derived from molecular
absorption line observations concerning the invariance of physical co
nstants, such as the mass of the molecules. We discuss molecular line
data from redshifts 0.27-0.89, corresponding to look-back times of 30%
to 60% of the age of the universe.