My old car did the same thing, however it was not a Subaru. It was a Plymouth Laser and it would stall randomly and got worse as time went on, such as stalling on the highway. I tried replacing the fuel pump and fuel injectors, but it still did not work. I ended up having to buy a new computer for it and it ran perfectly. I got lucky and was able to find a computer for my car in a junkyard and got it for 25$. Maybe you will get lucky as well, if that is the problem