I reckon, generally, in day ODI's, if in doubt, bowl. In tests or day-nighters, if in doubt, bat.
In the current state of the ODI game there seems to be a significant advantage to knowing a) what the pitch is like and b) what run rate you require to win. In a day game, if the pitch is not too nasty, the side batting first usually needs at least 260 - 300 to win (depending on the pitch). Anything lower will be chased down, especially by attacking sides. The only time the 1st batters win with less than 260 odd is when they get a lot of early wickets or bowl the opposition out, which is a lot more likely in a day-nighter.
(This is why I would argue the tossing system needs to change. Take the last two India - Pakistan ODI series for example. Won and lost largely by a little piece of metal not by any players on the field! (Not to detract from any of those excellent players).)
As for tests, the toss is just as important but for different reasons. Most tests are won by the side batting first, especially if the teams are evenly matched. Basically it's the play off between atmosphere and pitch which decides it. Pitches normally end up helping bowlers on the last day, and are most batsman friendly on the first. However they sometimes peak on the second or third days if they are very green and bouncy on the first and dry out as time passes. This depends on the humidity of the air, which also helps swing bowling! So basically if sunny bat, if humid bowl.