In his early career, Foster served aboard HMS York. Later, he served aboard HMS Griper in 1823 as part of the British Naval Scientific Expedition to the Arctic led by Douglas Clavering. He assisted the astronomer Edward Sabine. He became a Fellow of the Royal Society.
In 1824 as a lieutenant, he joined the Northwest Passage expedition led by Captain William Edward Parry, aboard HMS Hecla. He made various scientific observations in magnetism and astronomy and pendulum measurements of gravity, for which he shared the Copley Medal in 1827 and received the rank of commander. Later in 1827 he joined the British Naval North Polar Expedition, again under the leadership of Parry.
From 1828 to 1831, he was commander of HMS Chanticleer and led the British Naval Expedition to the South Atlantic, surveying the South Shetland Islands and notably Deception Island off the Antarctic Peninsula. The expedition was to survey the coasts and land formations, as well as to determine the direction of ocean currents in both hemispheres. He named the Wollaston Islands of present-day Chile, in the Tierra del Fuego archipelago, after the British chemist William Hyde Wollaston. As well as surveying coasts and ocean currents, Foster used a Kater invariable pendulum to make observations on gravity. The survey included the archipelago and island of Fernando de Noronha. Foster was given considerable assistance by the Governor, who let Foster use part of his own house for the pendulum experiments. He published his research in an 1834 book, released posthumously.
He drowned in the Chagres River in Panama in 1831 after slipping and falling overboard. His book, published posthumously, was considered very important because of his observations on the southern hemisphere. It was translated into French and republished in 1849.