They took the fastest 36 in qualifying. Spots 37 through 42 were provisional starting spots. The 43rd spot was saved for a past champion, and if there wasn't a past champion needing it, then another provisional spot was allowed.
Teams started out each season with 4 provisionals. After every 8 qualifying attempts, a team picked up an additional provisional. If a team was in the top 25 in owner points and had to use a provisional to get into the race, they wouldn't get charged for using a provisional. If you were outside the top 25 and used a provisional you'd get charged. In 2001, Matt Kenseth used a provisional for 11 of the 36 races....yet when the season ended he still had all 8 of his provisionals left. The 4 he started the season with, he picked 1 up after the 8th race, another 1 up after the 16th race, another 1 after the 24th race, and another 1 after the 32nd race. But, to his credit, he was able to keep the team top 25 in points.
It wasn't out of the realm of possibility for a team say 31st in owner points to run out of provisionals until they made enough qualifying attempts to gain another 1. And that would lead to teams like 42nd, 43rd, in owner points getting in races with provisionals while the 31st place team had to go home. And it wasn't a case of where the 31st team could turn down a provisional; in other words they couldn't say to NASCAR, "we'll pass on using a provisional this weekend and go home and save our remaining provisional for a future race." One of the things that would happen is a race like the Brickyard (which has a big monetary purse) would be the 20th race on the schedule, and a team would pick up a provisional after the 16th race, but by the time the Brickyard rolled around they'd be out of provisionals again, and a team lower than them in owner points would get into the show, and get the nice payday at the Brickyard.
As I mentioned before the 43rd spot was saved for a past champion, if needed. Past champions were allowed to use up to 8 of those in a season.