Not sure what the first number does exactly, I think it controls the distance at which the fog starts. The second variable seems to control the 'density' of the fog - the bigger the number, the less foggy it appears.
The third three numbers set the colour of the fog (R;G;B). Some interesting effects are possible with fog for example,
using a SLIGHT red tinge (higher R value) on fog at dawn / dusk
using quite dense, nearly black fog (eg R;G;B 10;10;10) in tunnels can be used to simulate the view which you would get with headlight illumination. This effect needs a degree of graduation as you enter a tunnel, for example try this in a tunnel,
500,.fog -80;800;0;0;0,
525,.fog -80;400;0;0;0,
550,.fog -80;200;0;0;0,
575,.fog -80;100;0;0;0,
The reverse is needed on a tunnel exit with the fog also becoming whiter (increase equally the RGB values). Need to be very careful how you graduate the fog at tunnel exits otherwise outside the tunnel can end up looking dark.
Using this technique also allows you to add the effects of shafts in tunnels - just briefly increase the fog distance.
Another use of fog is to create night effects (just turn the fog off on some night routes to see the effect). By gradually increasing the denisty of the fog and making it darker through a route, it is possible to make it look like it is getting darker (or lighter).
Take some time and fiddle with the fog command - in my opinion a degree of fog is absolutely essential (how often is it completely clear in the real world). It can also help overcome problems of objects appearing suddenly in the distance and generally adds to the atmosphere. It is difficult to get just right but when it is the results are most satisfying.
To those who say fog slows BVE down I would reply get some more RAM - for the price of a day out, performance, not just of BVE, will be greatly improved.