In one of the concluding scenes of the movie Thor, it's shown that Loki deliberately let go of the Scepter, and falls deep into the vast intergalactic sea sort of thing. How does he survive and return in The Avengers?
It's heavily hinted that he was rescued by the Chitauri. In one scene, we see the character identified as The Other, scolding Loki:
The Other: You question us? You question him? He who put the scepter in your hand. Who gave you ancient knowledge and new purpose when you were cast out. Defeated!
In the course of the movie, it is revealed that the Chitauri struck a deal with Loki. He would help them get the Tesseract, and they would help him conquer Earth.
Presumably, he used his magic, which is quite powerful, to navigate the wormhole the Bifrost had opened. I don't know whether he sensed Thanos and navigated toward his presence or if Thanos sensed him and pulled him in or if Loki just happened to set himself down on a planet Thanos occupied. But he survived through sorcery.
The thing Loki falls into off of the Rainbow Bridge at the end of Thor is a wormhole. It's not entirely clear here that this is the case but it is obviously something a bit different than "normal space".
This is further backed up in The Art of Marvel's The Avengers where this is explicitly mentioned.
"At the end of Thor, Loki tells go of that spear and falls into a wormhole." Hiddleston said. "And the question in the audience's mind, one hopes, is what happens to Loki in that moment? And in the time between the end of Thor and the beginning of The Avengers, Loki has explored the shadowy highways and byways of the universe - and he's met some terrine, terrible people and probably had some awful experiences which he has survived and overcome. So by the time he arrives in The Avengers he knows the extent of his power - and he's unafraid to use it. And more importantly, he's unafraid to enjoy it."
The Art of Marvel's The Avengers
So, he survives because he doesn't actually die at the end of Thor, he's just transported someplace else. At some point in the journey's he clearly meets the Other/Thanos and that's when they plan to for Loki to take control of Earth.