Sensex is basically a weighted average of prices of 30 stocks. Similar to say a calculation of average of marks in exams with some papers having higher weightage and some having lower. In case of Sensex, weight assigned to individual stock is the free-float market capitalization.
You can read in details the calculation and methodology at following link- http://www.bseindia.com/about/abindices/bse30.asp