Aims. We aim at determining the spatial distribution of the gas and dust in star-forming regions and address their relative abundances in quantitative terms. We also examine the dust opacity exponent β for spatial and/or temporal variations. Methods. Using mapping observations of the very dense ρ Oph A core, we examined standard 1D and non-standard 3D methods to analyse data of far-infrared and submillimetre (submm) continuum radiation. The resulting dust surface density distribution can be compared to that of the gas. The latter was derived from the analysis of accompanying molecular line emission, observed with Herschel from space and with APEX from the ground. As a gas tracer we used N 2 H + , which is believed to be much less sensitive to freeze-out than CO and its isotopologues. Radiative transfer modelling of the N 2 H + (J = 3−2) and (J = 6−5) lines with their hyperfine structure explicitly taken into account provides solutions for the spatial distribution of the column density N(H 2 ), hence the surface density distribution of the gas. Results. The gas-to-dust mass ratio is varying across the map, with very low values in the central regions around the core SM 1. The global average, =88, is not far from the canonical value of 100, however. In ρ Oph A, the exponent β of the power-law description for the dust opacity exhibits a clear dependence on time, with high values of 2 for the envelope-dominated emission in starless Class -1 sources to low values close to 0 for the disk-dominated emission in Class III objects. β assumes intermediate values for evolutionary classes in between. Conclusions. Since β is primarily controlled by grain size, grain growth mostly occurs in circumstellar disks. The spatial segregation of gas and dust, seen in projection toward the core centre, probably implies that, like C 18 O, also N 2 H + is frozen onto the grains.