Pick up a good caulk gun at a paint store that sells better grade tools. A tile grout sponge is available at ceramic tile stores. These sponges differ from standard sponges because they have nice soft rounded edges.
Cut the tip to match the size of the crack you are filling. Too big of a hole in the caulk tube and you will have a real mess. Caulk about two feet at a time. Wipe off the excess caulk with your finger. Then, follow with the damp sponge to smooth out the patch and remove any caulk from the surrounding woodwork.
Done right, your paint job will look a lot better without the gaps between the woodwork and the walls.