#1 factor is your Internet connection. You might have a slowor laggy ISP, that is something you just have to check. However your hardware can factor in. Some ISP's have good throughtput but laggy (high latency connections). The only way to know which are best is to ask friends or try them out.
If you connect to the internet via a Modem, the fax modems (modems that will work in DOS and Linux) work better than the winmodems since they have their own proccessors onboard. Win modems send data through the cpu which takes time (causing additional lag).
1. Best DSL
2. Better Cable
3. Good "Fax Modem"
4. Worst Windows Modem
The best thing is a Cable modem or DSL connection. The DSL may not be as fast as some cable modems but you are the only one on it so it is generally less suceptible to trafic problems.
Even with a DSL or Cable modem you can be slowed by a poor network card or bad drivers so a good 3com card is usually a safe bet.
I have seen little hacks that canhelp by maxing port settings. However sometimes faster is not better. Your modem can choke and retrain if it is getting data too fast so if you don't need the throughput you may try slowing down the port speed settings a little. This might give you a more stable connection. you just have to test it.
Hopes this helps!
I know how bad lag sucks for everyone in the game..