Random scattering of light, e.g., in paint, cloud and biological tissue, is a common process of both fundamental interest and practical relevance. The interference of multiply scattered waves 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 in optics enabled imaging and focusing of light through opaque samples. By selective coupling to high or low transmission eigenchannels, we varied the transmission of a laser beam through a highly scattering system by two orders of magnitude, and drastically changed the energy density distribution inside the system. Furthermore, we utilized the multiple scattering of light in a random structure to realize a chip-scale spectrometer. The speckle pattern is used as a fingerprint to recover an arbitrary spectrum. Such a spectrometer has good spectral resolution and wide frequency range of operation.