Tesla crossed $500 billion in market value today as investors lapped up its shares in the run-up to its addition to the S&P 500 index, extending a meteoric rally that has seen the stock gain more than six times this year. 

Shares of the electric-car maker have risen nearly 28% since the S&P Dow Jones Indices decided to add the company to the benchmark index from December 21. 

Its shares rose as much as 3.9% to a record high of $542.35 in early trading, valuing the company briefly at $514 billion. 

The recent rally has also boosted chief executive Elon Musk's net worth by $7.2 billion to $127.9 billion, helping him go past Bill Gates to become the world's second-richest person, according to the Bloomberg Billionaires Index. 

Musk, who was ranked 35th in January, has added $100.3 billion to his net worth so far this year, according to the index. 

Tesla has become by far the world's most valuable automaker, despite a production that is a fraction of Toyota, Volkswagen or General Motors. 

Shares of other electric vehicle (EV) makers have also risen in the last few months as President-elect Joe Biden made boosting EVs a top priority during his campaign.