Accommodation is limited, particularly in the cities, and cheap hostels are very few. There has never been a tradition of backpacker traveling in Russia, at least not in the big cities.
Staying with friends or contacts is a good option, and is something all Russians are used to doing for precisely that reason. You will often see people holding signs outside main rail stations, offering homestays.
There are a lot of hotels in Moscow and St Petersburg but they are mostly way too expensive and have the highest occupancy rates in Europe. Some new three-star stuff is starting to be built now, but it will be a few years before they are up and running. One way to cut hotel bills is to take an overnight train to your next destination, rather than a daytime one, timetable permitting.