Ah, the ever-present battle of Music and Dialogue ;)
As Shaun and some others have mentioned, context is everything. A perfectly poor example in my opinion is Inception. Overall, production is pretty crystal clear so they can rock the music nice and loud. But Ken Watanabe has a thick accent, so much so that the music drowned him out in 2 specific spots (if not more). It was about the 3th time I saw the film in a theater that I finally understood what he said (and I'm a dialogue editor). So in this case, I feel the music was mixed well against very clear English-language for an English-language audience, but in the case of someone who wasn't speaking so clearly in English, it wasn't mixed well in my opinion.
The approach I like with music when I'm mixing is to set up my submaster to give it about a 3-4dB attenuation at 1kHz with about a 0.75-1.0 Q. Always - never gets automated, just sits there globally. I've found that this little attenuation allows the dialogue to more effectively cut through at the chief intelligibility range and lift it dimensionally off the screen. I then follow it up with a stereo imager - my personal favorite is the one by Flux because it has a nice fat phase scope so I can see what's going on. It's set to a conservative width of +0.7 to +1.0 dB. Again, not enough to change the characteristics, but it helps open up that center-channel 'hole' so that music can be pushed more aggressively without blurring dialogue. The catch here though is I only use this stereo imager when mixing in a 2.0 environment, not 5.1. This imaging width increase I find helps simulate the LCR discreteness that's heard when a true 5.1 is folded down and played back. In 2.0 we don't have that center channel dedicated to dialogue, so the stereo imaging width helps carefully simulate that "forced discreteness" to be allocated across the LR phantom center more decisively, rather than the blurry LCR image that a 2.0 naturally has.
After that, for me it's about babysitting the meters and riding the levels of music against the dialogue intuitively. I personally prefer not to work with expanders/sidechain compressors. Nothing against them, the faders just feel more comfortable to me. The goal to my ears is the make sure dialogue is always heard, but at the same time respect the composer's material and push it where its appropriate to give it moments to shine when dialogue is robust enough to handle the music rockin' or where there's no dialogue. Shaping the volume ramping too is one of those intuitive things, but I try to follow the natural crescendos and rise/falls of the music so that the build up or build down has a natural feel - sometimes it means quick a sudden changes, and other times it can very long and gentle
I wish I had a more quantitative way to answer the question as far as the automating/mixing goes, yet unfortunately that's the best angle I can share. With post sound I've observed that I work intuitively under a mantra which has resonated with me the most - "if it sounds good, it is good".