I've been living in the bay area for about 7 years working as a software engineer. When I arrived, rent was around 1.7k for a 2 bed 2 bathroom apartment. Today, the same place charges you around 3.5k. The cost more than doubled while this is pretty much not true about your salary.
You either need to get huge promotions in 7 years to double your salary which is very difficult (and this is just to keep your living standards) or be forced to move to somewhere farther and face a crushing commute of at least 2 to 3 hours everyday.
Roughly speaking, buying a house is also not a win since houses closer to where you work will usually be more than 1 million dollars. Mortgage would be around 4k-5k with 20% down payment. So again, you'd be forced to buy somewhere farther.
There's really not much to do about it, it's supply and demand and you need to accept it. There are a couple of things though that tech companies could do: either working with local authorities to help improve public transportation or decentralize the workplace.
Companies, however, are doing exactly the opposite: Buying lands which were previously residential areas and building huge mega-structures so everyone can work in a single place while not having the best from public transportation (e.g. Apple).
I naively thought that making the lives of their employees easier would be in the best interests of tech companies but I just see things getting worse every year.