I, like almost all multiplayer gamers, play on random maps. I have to analyze the map immediately as I scout it to determine what my strategy will be. One of the first things I do is look for the distance to my nearest enemy, and this dictates how much I should spend on military tech.
This is more of a guideline rather than a rule. If I'm 2 jumps from an enemy, but the planet between us is a desert with massive amounts of militia, that's probably going to prevent an early rush. On the other hand, a chain of three asteroids between us might give a 4-jump distance, but the massive priority of those asteroids is going to force me to play extremely aggressively.
With that disclaimer, here's my guideline:
1-2 jumps: All military, don't spend a penny on anything that isn't going to have an immediate impact on the fight. Unless you're specifically pursuing a double-cap strategy, you should scuttle your capital ship factory after you're done with it. Every penny counts. You do not have time to colonize planets other than asteroids in this very dangerous situation.
3-4 jumps: You should be putting the vast majority of your income into military tech. You do have some leeway for non-military investment, but it should make up only a tiny fraction of your total expenditure. Building civic labs to access ice/volcanic planets is a major risk here; it can pay off, but you have to be very careful when doing this since you won't have repair bays or higher tech units for some time.
5-6 jumps: This is a reasonable distance where you can realistically pursue an economic strategy. However, you have to be aware of your enemy and be prepared to defend yourself. That means identifying and claiming choke points early, and also keeping active scouts in between your empires to know if he's heading towards you. You're still close enough to rush, so you need to be ready with a military or at very least the capacity to produce one on very short order.
7-8 jumps: In these positions, it's very difficult to rush and chances are an economic lead is the important thing to build here. You can very safely pursue civic labs and try to colonize a large number of planets. However you must be conscious of where your enemy is and when he intends to strike. Any rush is going to be delayed just by distance, but it's still entirely feasible for an enemy to attack early on and hit you before you're ready. In fact, many players are all the more vulnerable because they think it's safe to go all-out on their economy, and then have nothing to stop an attacker.
9+ jumps: This is an extremely rare scenario, but at these distances it's practically impossible to rush. It's safe to go straight for economic techs and build up a stronger foundation. You always have to be cautious of the enemy trying an aggressive ploy, but he's going to have a lot of trouble getting in position to do this early on. Chances are he won't try that (at least until later...) and instead will focus on building up himself. The one thing to be careful about is that in this scenario it's actually very easy to have heavy cruisers ready for the first major fight, so you have to scout and know what's coming so you have the counters researched.