The Black-Scholes formula values options. It is the most widely used method of valuing options but others do exist. These more complex alternatives are used when the assumptions made by Black-Scholes may not be accurate.
The Black-Scholes formula for the price of a call option is:
where s is the price of the underlying security
N(x) is the cumulative standard normal distribution of x
e is the mathematical constant
r is the risk free rate of return
X is the exercise price of the option
T is the time of expiry of the option
t is the time at which the option is being valued
σ is the volatility of the option
d1 is (1/(σ√(T-t))(ln(s/X)+(r+σ2/2)(T-t)) and
d2 is d1 - σ√(T-t).
There is more than one way of deriving Black-Scholes. Even the easiest is a little too mathematical to cover here, but is well described in a number of textbooks. The derivation starts from the construction of a portfolio that uses delta hedging to generate the same cash flows as an option. By the law of one price this must have the same value as the option. A fuller explanations can be found here,.
The Black-Scholes formula has some weaknesses: for example, it assumes that the probabilities of future prices of the underlying security follow a normal distribution. This is an approximation that is good enough most of the time — but the wide use of Black-Scholes creates some opportunities for traders and arbitragers who can model something more complex when necessary.
It can also be used to calculate share prices by regarding shares as an option to own a business outright by paying off the debt. If a business becomes worth less than its debt then a company can default leaving shareholders with nothing and debt holders with the business. This is not usually of much practical use but does explain why shares have a positive value even if a company's EV is less than its outstanding debt.