The act of selling goods or services to a foreign country is called exporting. The act of buying goods or services from a foreign country is called importing. Together exporting and importing are collectively called international trade.
There are a number of advantages for citizens of a country with an open economy. One primary advantage is that the citizen consumers have a much larger variety of goods and services from which to choose from. As well consumers have an opportunity to invest their savings outside of the country.
In an open economy, a country's spending in any given year need not to equal its output of goods and services. A country can spend more money than it produces by borrowing from abroad, or it can spend less than it produces and lend the difference to foreigners.
With Y being gross domestic product / national income, is consumer consumption of domestic goods and services, is investment in domestic goods and services, is government expenditures on domestic goods and services. The term is usually called net exports and is sometimes designated with the term NX.