We review theories and experiments on the effects of shear in fluids undergoing phase transitions. We put emphasis on near-critical fluids and polymer solutions as representative examples, but also discuss related problems in polymer blends, gels, and surfactant systems, etc. In near-critical fluids, convective deformations can drastically alter the critical behaviour, spinodal decomposition, and nucleation. In this case the hydrodynamic interaction suppresses the fluctuations and gives rise to a downward shift of the critical temperature (shear-induced mixing). The rheology in two-phase states, and effects of random stirring are also reviewed. In semidilute polymer solutions near the coexistence curve, on the other hand, the composition fluctuations can be strongly influenced by the viscoelastic stress. In shear flow, this dynamical coupling results in enhancement of the composition fluctuations (shear-induced demixing). They grow, but are eventually disrupted by convective deformations, yielding chaotic dynamical steady states where phase separation is incompletely taking place. Such nonlinear shear regimes are examined using computer simulations based on a viscoelastic Ginzburg-Landau model.