Facebook Inc. made its second blockbuster acquisition of the year, agreeing Tuesday to acquire Oculus VR Inc., a 20-month-old maker of virtual-reality goggles, for $2 billion in cash and stock.

Like Facebook's $19 billion purchase last month of text-messaging service WhatsApp, the deal is part of the social-networking company's vast ambition to connect people across all kinds of devices and modes of communication.

The...