Who Owns Space? Freedom of enterprise on the frontier

Citizens are going into space. Who has the right to do what and where out there? How do we avoid the mistakes made on Earth, yet encourage the harvest of space resources that might save the planet? How do we make sure no one grabs the solar system yet enable regular people to dream they might own a house on the Moon or homestead Mars?