check out wiki for more info.
P/E RATIO
In finance, the P/E ratio of a stock (also called its "earnings
multiple", or simply "multiple" or "PE" ) is used to measure how
cheap or expensive share prices are. It is probably the single most
consistent red flag to excessive optimism and over-investment. It
also serves, regularly, as a marker of business problems and
opportunities. By relating price and earnings per share for a
company, one can analyze the market's valuation of a company's
shares relative to the wealth the company is actually creating. A
PE ratio is calculated as:

The price per share (numerator) is the market price of a single
share of the stock. The Earnings per share (denominator) is the Net
income of the company for the most recent 12 month period, divided
by number of shares outstanding.
The PE of a stock describes the price of a share relative to the
earnings of the underlying asset. The lower the PE, the less you
have to pay for the stock, relative to what you can expect to earn
from it. The higher the PE the more over-valued the stock is.
For example, if stock A is trading at $24 and the Earnings per
share for the most recent 12 month period is $3, then the PE ratio
is 24/3=8. Stock A said to have a PE of 8 (or a multiple of 8 ).
Put another way, you are paying $8 for every one dollar of
earnings.
The main reason to calculate PEs is for investors to compare the
value of stocks, one stock with another. If one stock has a PE
twice that of another stock, it is probably a less attractive
investment. But comparisons between industries, between countries,
and between time periods are dangerous. To have faith in a
comparison of PE ratios, you should be comparing comparable
stocks.
Normally, stocks with high earning growth are traded at higher PE
values. Say, Stock A may earn $6 per share the next year. Then the
future PE ratio is $24/6 = 4. i.e. you are paying $4 for every one
dollar of earnings which is more attractive.
EARNINGS PER SHARE
Earnings per share (EPS) are the earnings returned on the initial
investment amount.
The FASB requires companies' income statements to report EPS for
each of the major categories of the income statement: continuing
operations, discontinued operations, extraordinary items, and net
income.
The EPS formula does not include preferred dividends for categories
outside of continuing operations and net income as shown here. This
formula also shows the most basic formula for earnings per
share.

The EPS formula is shown here for Net Income and Continuing
Operations (substitute income from continuing operations for net
income).

Earnings per share for continuing operations and net income are
more complicated in that any preferred dividends are removed from
net income before calculating EPS. Remember that preferred stock
rights have precedence over common stock. If preferred dividends
total $100,000 (this part i
dunno, suddenly got number come out one), then that is money
not available to distribute to each share of common stock.
The value used for company earnings can either be the last twelve
months' Net income (referred to as trailing-twelve-months, or ttm),
or analysts' predictions for the next twelve months' net income
(referred to as forward).
The number of shares used for the calculation can either be basic
(only shares that are currently outstanding) or diluted (includes
all shares that could potentially enter the market).
Companies often use a weighted average of shares outstanding over
the reporting term. EPS can be calculated for the previous year
("trailing EPS" ), for the current year ("current EPS" ), or for
the coming year ("forward EPS" ). Note that last year's EPS would
be actual, while current year and forward year EPS would be
estimates.