A pentaprism is a five-sided reflecting prism used to deviate a beam of light by a constant 90°, even if the entry beam is not at 90° to the prism. The beam reflects inside the prism twice, allowing the transmission of an image through a right angle without inverting it (that is, without changing the image's handedness) as an ordinary right-angle prism or mirror would.
The reflections inside the prism are not caused by total internal reflection, since the beams are incident at an angle less than the critical angle (the minimum angle for total internal reflection). Instead, the two faces are coated to provide mirror surfaces. The two opposite transmitting faces are often coated with an antireflection coating to reduce spurious reflections. The fifth face of the prism is not used optically but truncates what would otherwise be an awkward angle joining the two mirrored faces.
Roof pentaprism 
A variant of this prism is the roof pentaprism which is commonly used in the viewfinder of single-lens reflex cameras. In this case, the image needs to be reflected left-to-right, as the prism transmits the image formed on the camera's focusing screen, which is itself reflected by the reflex mirror in the camera body. This reflection is done by replacing one of the reflective faces of a normal pentaprism with a "roof" section, with two additional surfaces angled towards each other and meeting at a 90° angle. This form of the prism changes the handedness of the image.