Bertram Pincus (Ricky Gervais) finally stops being a jerk and starts helping the ghosts resolve their lingering issues. Only then can they go "into the light."
Frank (Greg Kinnear) goes into the light to once he helps Bertram win over his widow, Gwen (Tea Leoni).
Frank and Gwen live happily ever after.
Note: I loved this movie, and my pooper doesn't do it justice. See it!