Bärschwil is a village and municipality in the district of Thierstein in the canton of Solothurn in Switzerland.