The phrase "before it rains" is an adverbial clause of time, indicating when we should go inside.