If there are 39 students in the bike club and all but 8 of them participated in the race, that means 39 - 8 = 31 students participated in the race.
If each participating student paid $6, then the total cost for the race is:
31 students × $6 = $186.
So, the total cost for the race is $186.