That got me thinking.
This should be a quick & dirty solution (I'm not sure if this is what @EJB had in mind)
Lets say the number of tickets purchased are in column A, starting From row 2. Add 2 columns, let's say E&F.
In F put
=A2+F1
And in E put
=F2-(A2-1)
This will give you the range of ticket numbers for each purchase, Column E through column F
Similar, but see attached for something I made in literally 30 seconds.
Add the names and number of tickets they bought in columns A and B
Column C calculates a running total of the ticket #s
F2 randomly draws a number between 1 and the total of the tickets purchased. Every time you press F9 it will redraw until my ticket wins.