The polarimetric properties of the radiation scattered in molecular lines are analyzed in detail. After reviewing the theory appropriate to the case of laboratory experiments, which allows to define a polarizability factor relative to the processes of Rayleigh and Raman scattering, the same theory is generalized to handle the case of an astrophysical environment, such as a stellar atmosphere, where each molecular level is pumped by several transitions at a time. A generalized polarizability factor is defined and its analytical value is derived in the simpler case where atomic polarization is neglected in the lower molecular levels from which the pumping process is taking place. These analytical results are first obtained for spinless molecules and are later generalized to molecules of increasing complexity, taking into account the complications introduced by the phenomenon of Lambda-doubling and those due to the presence of spin in the coupling scheme of Hund's case (b). An analytical result is also presented in the form of a theorem for the case where atomic polarization is allowed to be present in the lower molecular levels. The theorem has important consequences on the diagnostic content of solar limb observations (performed over the disk) of molecular lines of high J-values, whose polarization properties result in being mostly insensitive to any depolarizing mechanism affecting the lower level (including the lower-level Hanle effect). Some final remarks are presented concerning the upper-level Hanle effect in typical molecular lines. It is shown that the magnetic fields values which are capable of depolarizing atomic lines via the Hanle effect also depolarize molecular lines with approximately the same efficiency. This last result contradicts a previous statement by Berdyugina, Stenflo & Gandorfer (2002, A&A 388, 1062) according to whom molecular lines should be "immune" to the Hanle effect.