Some turn lemons into lemonade. When Josh Kilmer-Purcell and Brent Ridge found themselves unemployed with two mortgages and 80 goats to feed, they turned goat milk into gold.

“When life gives you goat milk, you are going to make every single thing you can make out of goat milk,” Mr. Ridge said Sunday night at the Chilmark Community Center. First came the hand-wrapped goat milk soap. Then came caramel, cheese, fudge sauce — it all added up to a thriving business.

Speaking as part of the Chilmark author lecture series, Mr. Ridge and Mr. Kilmer-Purcell recalled the twists and turns that took them from successful careers in New York city to entrepreneurs at the heart of Beekman 1802, a company based on their farm in Sharon Springs, N.Y.

In 2006, the couple was vacationing in upstate New York when they stumbled onto the Beekman farm in Sharon Springs, a town with a Main street about as long as the Chilmark Community Center, they recalled. Pretty soon the New Yorkers were also farm owners, thinking of their new property, which included a handsome white house and a red barn, as a second home.

Vineyard farmers come to hear what the Beekman Boys are up to. — Ivy Ashe

But then in 2008, like many others, they were hit hard by the economic downturn. Mr. Kilmer-Purcell, an ad executive, author and former drag queen, and Mr. Ridge, a doctor, MBA, and former executive at Martha Stewart Living, lost their jobs within a month of each other. Not knowing what else to do, they decided to try to make a go of their farm, with Mr. Ridge focusing on the farm and Mr. Kilmer-Purcell continuing to pursue work in New York.

Shortly after purchasing the property, they received a handwritten letter from John Hall, a nearby goat farmer who needed to find a new home for his 80 goats. Those goats and the milk they provided played a crucial role in building the Beekman 1802 brand. The company is named after the original owner of the farm and the year it was built.

But “you’re not going to pay a million dollar mortgage with soap,” Mr. Ridge told the crowd. They started looking at what else they could offer, and began talking to their neighbors in Sharon Springs, people who had skills the Beekmans could learn from and help market.

“We call ourselves farmers,” Mr. Kilmer-Purcell said, but “the thing that we had to offer . . .  we knew how to market things.”

“When you think about all the amazing farms on Martha’s Vineyard,” Mr. Ridge said, “everything a farmer has to do is almost overwhelming. It’s probably one of the hardest jobs on earth.”

Success did not come easily, but gradually other opportunities emerged. They filmed a reality TV show, The Fabulous Beekman Boys, for Planet Green. Mr. Kilmer-Purcell said the show was pitched as “the gay Green Acres.” The show featured the goats, the couple’s efforts to build a business and learn how to be farmers, and their diva llama, Polka Spot.

Cookbooks, goat's milk soap, a reality show - all adds up to a big brand, and signing autographs. — Ivy Ashe

It also put Sharon Springs on the map. The Beekmans started a Harvest Festival in town, with 500 people attending the first year. The next year, as the show began airing, 5,000 people showed up to visit the small town.

Through another twist of fate, the Beekman Boys ended up on the CBS reality show The Amazing Race as one of 11 duos racing around the world. The most trying challenge, Mr. Kilmer-Purcell said, was learning a synchronized swimming routine from a coach who only spoke Russian. Just scraping by for most of the trip, Mr. Kilmer-Purcell and Mr. Ridge ended up winning the race, and the $1 million prize that comes with it.

With the Amazing Race winnings helping them pay off their mortgage, the Beekman Boys are now donating a quarter of the profits from their Mortgage Lifter tomato sauce to small American farms. The first year, they gave away $13,000.

The Beekman Boys both agreed that they have embraced the change of pace that comes with farm life, including doing most of their own cooking from their own crops.

“Before, everything was about instant gratification,” Mr. Ridge said. Life on the farm has changed that. He said if they run out of the last of their tomatoes in March, they have to wait until August to pluck one off the vine.

“There is power in delayed gratification,” he added. “It absolutely does make the heart grow fonder, and that’s our biggest lesson.”

After speaking and taking questions from the audience, Mr. Ridge and Mr. Kilmer-Purcell signed copies of their newest cookbook, The Beekman 1802 Heirloom Vegetable Cookbook.

“To us an heirloom is anything that has value greater than its monetary value,” Mr. Ridge said. “Something so well made, it lasts.”

They also posed for a picture with several Vineyard farmers.

“Now let me tell you,” Mr. Ridge told the group after the photo. “The first thing about marketing, have some things with your name on them.”

“I really appreciate what they said about farming,” said Andrew Woodruff of Whippoorwill Farm.

During their quick trip to the Island — farm chores would take them back home Monday morning — the Beekman Boys toured several Vineyard farms.

“We love it,” Mr. Ridge told the Gazette. “Even in our county, which is almost exclusively agricultural, there aren’t as many farm stands as on Martha’s Vineyard.”

He also had words of caution for those looking to start their own farm.

“Whatever is your plan A, have a plan B,” Mr. Ridge said. “Because farming is incredibly hard.”

He said average revenue is around $15,000 a year. "You have to figure out who is going to be the breadwinner."

“Always think of creating value added products,” he added. “You’re not going to make money just selling a basic crop.” He cited Mermaid Farm’s lassis as an example of a value added product.

Even Beekman farm’s llama, Polka Spot, is part of the plan. She is the star of four comic books and the “Polka Spotted” app that will insert the llama into any picture. She has more than 13,000 followers on Facebook.

“When you see something becoming popular, you have to market it,” Mr. Ridge said.

The 2014 Author Lecture Series continues on Thursday, July 31, with a celebration of Sheldon Hackney, on August 3 with Andre Dubus III, and on August 7 with Ron Suskind.