Moldings and trim generally look best when they are fitted tightly to walls and ceilings. Small gaps show shadow lines and leave the trim looking unfinished.
To fill gaps between moldings and the ceiling or walls, apply a bead of siliconized-latex caulk. This is flexible enough to ride out any movement caused by moisture changes.
Apply a 1/8-inch bead of the sliconized-latex with a caulking gun, then dampen your finger with water and smooth the caulk.