In astronomy, a common envelope (CE) is gas that contains a binary star system.  The gas does not rotate at the same rate as the embedded binary system. A system with such a configuration is said to be in a common envelope phase or undergoing common envelope evolution.
During a common envelope phase the embedded binary system is subject to drag forces from the envelope which cause the separation of the two stars to decrease. The phase ends either when the envelope is ejected to leave the binary system with much smaller orbital separation, or when the two stars become sufficiently close to merge and form a single star. A common envelope phase is short-lived relative to the lifetime of the stars involved.
Evolution through a common envelope phase with ejection of the envelope can lead to the formation of a binary system composed of a compact object with a close companion. Cataclysmic variables, X-ray binaries and systems of close double white dwarfs or neutron stars are examples of systems of this type which can be explained as having undergone common envelope evolution. In all these examples there is a compact remnant (a white dwarf, neutron star or black hole) which must have been the core of a star which was much larger than the current orbital separation. If these systems have undergone common envelope evolution then their present close separation is explained. Short-period systems containing compact objects are sources of gravitational waves and Type Ia supernovae.
A common envelope is sometimes confused with a contact binary. In a common envelope binary system the envelope does not generally rotate at the same rate as the embedded binary system; thus it is not constrained by the equipotential surface passing through the L2 Lagrangian point.  In a contact binary system the shared envelope rotates with the binary system and fills an equipotential surface. 
A common envelope is formed in a binary star system when the orbital separation decreases rapidly or one of the stars expands rapidly.  The donor star will start mass transfer when it overfills its Roche lobe and as a consequence the orbit will shrink further causing it to overflow the Roche lobe even more, which accelerates the mass transfer, causing the orbit to shrink even faster and the donor to expand more. This leads to the run-away process of dynamically unstable mass transfer. In some case the receiving star is unable to accept all material, which leads to the formation of a common envelope engulfing the companion star. 
The donor's core does not participate in the expansion of the stellar envelope and the formation of the common envelope, and the common envelope will contain two objects: the core of the original donor and the companion star. These two objects (initially) continue their orbital motion inside the common envelope. However, it is thought that because of drag forces inside the gaseous envelope, the two objects lose energy, which brings them in a closer orbit and actually increases their orbital velocities. The loss of orbital energy is assumed to heat up and expand the envelope, and the whole common-envelope phase ends when either the envelope is expelled into space, or the two objects inside the envelope merge and no more energy is available to expand or even expel the envelope.  This phase of the shrinking of the orbit inside the common envelope is known as a spiral-in.
Common envelope events (CEEs) are difficult to observe. Their existence has been mainly inferred indirectly from presence in the Galaxy of binary systems that can not be explained by any other mechanism. Observationally CEEs should be brighter than typical novae but fainter than typical supernovae. The photosphere of the common envelope should be relatively cool—at about 5,000 K—emitting a red spectrum. However its large size should lead to a large luminosity—on the order of that of a red supergiant. A common envelope event should begin with a sharp rise in luminosity followed by a few months long plateau of constant luminosity (much like that of type II-P supernova) powered by the recombination of hydrogen in the envelope. After that the luminosity should decrease rapidly. 
Several events that resemble the description above have been observed in past. These events are called luminous red novae (LRNe). They are subset of a broader class of events called intermediate-luminosity red transients (ILRTs). They have relatively slow expansion velocities of 200–1000 km/s and total radiated energies are 1038 to 1040 J. 
The possible CEEs that have been observed so far include: