The space between the wall (gray) and the ceiling (lighter gray) was filled with expanding firecode foam (orange). The foam is sticky when applied; it will be covered up by crown molding later. The idea of the orange foam is to prevent a fire from quickly moving from unit to unit. This is a code requirement by the local municipality and a sensible safety precaution too.