Prisms bend light by refraction. This animation shows monochromatic (single colour) light beams passing through a triangular prism whose shape varies with time. As the prism widens at its base so the rays are bent (refracted) more. Prisms have many uses in optical devices.
In reality, when beams of white light pass through a prism the light resolves into different colours and creates a spectrum of colours. This happens because each wavelength of light has a slightly different refractive index for a given material. The higher energy (shorter wavelength) or blue light is refracted more than the lower energy (longer wavelength) or red light. The various wavelengths that make up white light (e.g. sunlight) all get refracted by a different amount and so the light is dispersed into its constituent colours. This produces the familiar rainbow of colours or spectrum.
While this dispersion is nice in a prism it causes problems in lenses. Lenses are designed to focus light perfectly but, because of the different degrees of refraction of the various wavelengths of light, the different colours get focused at different points. This blurs the image and creates coloured outllines. The defect is called chromatic aberration.