Random scattering of light, e.g., in paint, clouds, and biological tissue, is a common process of both fundamental interest and practical relevance. The interference of multiply scattered waves also leads to remarkable phenomena in mesoscopic physics such as Anderson localization and universal conductance fluctuations. In applications, optical scattering is the main obstacle to imaging or sending information through turbid media. Recent developments of adaptive wavefront shaping and phase recording techniques in optics have enabled the experimental demonstrations of imaging and focusing light through opaque samples. By shaping the incident wavefront of a laser beam, we enhanced the total transmission through a diffusive system by more than one order of magnitude, and modified the intensity distribution inside the highly scattering structure dramatically. For application, we developed a chip-scale spectrometer with disordered photonic nanostructures. A broadband enhancement of spectral resolution is achieved via multiple scattering of light.