I have a 2003 forester XS premium. Right now it's in Tennessee, but came from DC/Maryland area. (If this matters!!) To start off with, at night I noticed my lights would dim and brighten. Sometimes going completely off. It also seemed to lose power when this happened. Last week as I put it into park and was rolling window up at the same time, it died (all dash lights come on, no power, you could hear the engine shut down.) When it registered in my head that my car died, it started back up on its own. Last night my sons car broke down on him so he took mine to town. He calls me freaking out because as he was driving down the road (probably about 40-50mph) he said the car died and started back up on its own. I'm not sure it the lights and the dying are the same problem but figure it is possible. Any ideas?
Dimming lights sounds to me like bad grounding. Clean both battery posts and cables. Look around the vehicle and engine for grounding points. Remove each one you find, clean and re-install. There are a bunch of grounding points so be patient and methodical. As you encounter electrical connectors, unplug them and re-plug them a few times - clears out the cobwebs. FWIW, remember that Subaru switches the grounds on your headlights.
The engine stalling and restarting at speed could be grounding related, but also a fuel issue / fuel pump issue. Check power and ground to the fuel pump - unplug and re-plug the connector a few times. You might also run some kind of fuel system cleaner through the tank (Sea Foam is popular).
The engine stalling and restarting might be related to your ignition system. Check the high tension wires carefully. For a 2003 vehicle, if your wires are original, they're due for a change - get an OEM wire set or a set from NGK.
While your at it, you might check / change the plugs. Your vehicle has a so-called 'wasted spark' system - NGK makes a 'dual platinum' plug that works nicely with this system. Finally, check your spark coil for connection - both low and high voltage connections. If you remove it from the vehicle, inspect it for tracking or high voltage breakdown.
Still on a possible electrical / ignition issue, you might try this. Get a garden hose with a nozzle set to fine mist. Go out at night (when it's dark) and raise the hood, start your vehicle. After it's running and warmed up, stray the engine with the fine water mist. A well turned out engine should not be affected by the mist. If you have bad ignition wires or sparking coil, the results can be quite dramatic.