Around 100 firefighters responded to quell the blaze at the farm in Kleindietwil in the municipality of Madiswil that broke out at around 10.15pm, Bern cantonal police said in a statement on Sunday.
Residents of the home were able to leave the house unharmed while animals escaped injury, the statement said.
Firefighters had difficulty responding to the fire because the nearest source of water was a kilometre away, police said.
While they could not save the home and outbuildings they managed to prevent the fire from spreading to a neighbouring home, where residents were evacuated.
The lightning strike cut electricity to homes in the area.
The storm came after temperatures rose as high as 35C in parts on Switzerland on Saturday for a second day.
MeteoSwiss, the national weather office, forecast heavy rain for Sunday night, issuing a level three danger warning for western Switzerland, including the Lake Geneva and Jura regions.
Cooler weather is predicted on Monday but temperatures are expected to rise on Tuesday.
By Wednesday highs of 33C are on the cards for places as divers as Basel, Sion (in the capital of Valais) and Chur, while temperatures are set to rise well above 30 degrees again in Geneva, Zurich and Lugano.