<?xml version="1.0" encoding="utf-8"?>
<InstanceReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Version>1.0.0.3</Version>
  <hasSegments>false</hasSegments>
  <ReportName>12. EARNINGS PER SHARE AND SHAREHOLDERS' EQUITY</ReportName>
  <RoundingOption />
  <Columns>
    <Column>
      <LabelColumn>false</LabelColumn>
      <Id>1</Id>
      <Labels>
        <Label Id="1" Label="3 Months Ended" />
        <Label Id="2" Label="Sep. 30, 2009" />
        <Label Id="4" Label="USD / shares" />
      </Labels>
      <CurrencySymbol>$</CurrencySymbol>
      <hasSegments>false</hasSegments>
      <hasScenarios>false</hasScenarios>
      <Segments />
      <Scenarios />
      <Units>
        <Unit>
          <UnitID>Shares</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace />
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>USD</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>USDperShareItemType</UnitID>
          <UnitType>Divide</UnitType>
          <NumeratorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </NumeratorMeasure>
          <DenominatorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace />
          </DenominatorMeasure>
          <Scale>0</Scale>
        </Unit>
      </Units>
    </Column>
  </Columns>
  <Rows>
    <Row>
      <Id>2</Id>
      <Label>Notes to Financial Statements [Abstract]</Label>
      <Level>0</Level>
      <ElementName>cah_NotesToFinancialStatementsAbstract</ElementName>
      <ElementPrefix>cah</ElementPrefix>
      <IsBaseElement>false</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ElementDataType>string</ElementDataType>
      <ShortDefinition>Notes to Financial Statements [Abstract]</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>true</IsAbstractGroupTitle>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsEPS>false</IsEPS>
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText />
          <NonNumericTextHeader />
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
        </Cell>
      </Cells>
      <ElementDefenition>Notes to Financial Statements [Abstract]</ElementDefenition>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
    <Row>
      <Id>3</Id>
      <Label>12. EARNINGS PER SHARE AND SHAREHOLDERS' EQUITY</Label>
      <Level>1</Level>
      <ElementName>cah_StockholdersEquityAndEarningsPerShareTextBlock</ElementName>
      <ElementPrefix>cah</ElementPrefix>
      <IsBaseElement>false</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ElementDataType>string</ElementDataType>
      <ShortDefinition>Stockholders Equity and Earnings Per Share</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>false</IsAbstractGroupTitle>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsEPS>false</IsEPS>
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText>&lt;div&gt;
&lt;p style="MARGIN-TOP: 18px; MARGIN-BOTTOM: 0px"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;&lt;b&gt;12. EARNINGS PER SHARE
AND SHAREHOLDERS&amp;#x2019; EQUITY&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 6px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2%"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;&lt;b&gt;&lt;i&gt;Earnings
per Share&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 6px; TEXT-INDENT: 4%; MARGIN-BOTTOM: 0px"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Basic earnings
per Common Share (&amp;#x201C;Basic EPS&amp;#x201D;) is computed by dividing
net earnings (the numerator) by the weighted average number of
Common Shares outstanding during each period (the denominator).
Diluted earnings per Common Share (&amp;#x201C;Diluted EPS&amp;#x201D;) is
similar to the computation for Basic EPS, except that the
denominator is increased by the dilutive effect of vested and
unvested stock options, restricted shares and restricted share
units computed using the treasury stock method.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 12px; TEXT-INDENT: 4%; MARGIN-BOTTOM: 0px"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;The following
table reconciles the number of Common Shares used to compute Basic
EPS and Diluted EPS for the three months ended September&amp;#xA0;30,
2009 and 2008:&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; FONT-SIZE: 12px"&gt;
&amp;#xA0;&lt;/p&gt;
&lt;table border="0" cellspacing="0" cellpadding="0" width="76%" align="center"&gt;
&lt;tr&gt;
&lt;td width="76%"&gt;&lt;/td&gt;
&lt;td valign="bottom" width="7%"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td valign="bottom" width="7%"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-BOTTOM: #000000 1px solid" valign="bottom" colspan="3" align="center"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="1"&gt;&lt;b&gt;For&amp;#xA0;the&amp;#xA0;Three&amp;#xA0;Months&amp;#xA0;Ended&lt;br /&gt;
September&amp;#xA0;30,&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="bottom" nowrap="nowrap"&gt;
&lt;p style="BORDER-BOTTOM: #000000 1px solid; WIDTH: 40pt"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="1"&gt;&lt;b&gt;(in
millions)&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-BOTTOM: #000000 1px solid" valign="bottom" align="center"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="1"&gt;&lt;b&gt;2009&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td style="BORDER-BOTTOM: #000000 1px solid" valign="bottom" align="center"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="1"&gt;&lt;b&gt;2008&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#CCEEFF"&gt;
&lt;td valign="top"&gt;
&lt;p style="TEXT-INDENT: -1em; MARGIN-LEFT: 1em"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Weighted-average Common
Shares &amp;#x2013; basic&lt;/font&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;359.1&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;356.7&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p style="TEXT-INDENT: -1em; MARGIN-LEFT: 1em"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Effect of dilutive
securities:&lt;/font&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#CCEEFF"&gt;
&lt;td valign="top"&gt;
&lt;p style="TEXT-INDENT: -1em; MARGIN-LEFT: 3em"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Employee stock options,
restricted shares and restricted share units (1)&lt;/font&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;&amp;#x2014;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;4.4&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="FONT-SIZE: 1px"&gt;
&lt;td valign="bottom"&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&amp;#xA0;&amp;#xA0;&lt;/td&gt;
&lt;td style="BORDER-TOP: #000000 1px solid" valign="bottom"&gt;
&amp;#xA0;&lt;/td&gt;
&lt;td valign="bottom"&gt;&amp;#xA0;&amp;#xA0;&lt;/td&gt;
&lt;td style="BORDER-TOP: #000000 1px solid" valign="bottom"&gt;
&amp;#xA0;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p style="TEXT-INDENT: -1em; MARGIN-LEFT: 1em"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Weighted-average Common
Shares &amp;#x2013; diluted&lt;/font&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;359.1&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;font size="1"&gt;&amp;#xA0;&amp;#xA0;&lt;/font&gt;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;361.1&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="FONT-SIZE: 1px"&gt;
&lt;td valign="bottom"&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&amp;#xA0;&amp;#xA0;&lt;/td&gt;
&lt;td style="BORDER-TOP: #000000 3px double" valign="bottom"&gt;
&amp;#xA0;&lt;/td&gt;
&lt;td valign="bottom"&gt;&amp;#xA0;&amp;#xA0;&lt;/td&gt;
&lt;td style="BORDER-TOP: #000000 3px double" valign="bottom"&gt;
&amp;#xA0;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p style="BORDER-BOTTOM: #000000 0.5pt solid; LINE-HEIGHT: 8px; MARGIN-TOP: 0px; WIDTH: 10%; MARGIN-BOTTOM: 2px"&gt;
&amp;#xA0;&lt;/p&gt;
&lt;table style="BORDER-COLLAPSE: collapse" border="0" cellspacing="0" cellpadding="0" width="100%"&gt;
&lt;tr&gt;
&lt;td valign="top" width="4%" align="left"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;(1)&lt;/font&gt;&lt;/td&gt;
&lt;td valign="top" align="left"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;Due to the Company
incurring a loss from continuing operations and a net loss during
the first quarter of fiscal 2010, potential dilutive common shares
have not been included in the denominator of the dilutive per share
computation for the three months ended September&amp;#xA0;30, 2009 due
to their antidilutive effect.&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p style="MARGIN-TOP: 12px; TEXT-INDENT: 4%; MARGIN-BOTTOM: 0px"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;The potentially
dilutive employee stock options that were antidilutive for the
three months ended September&amp;#xA0;30, 2009 and 2008 were
22.3&amp;#xA0;million and 24.9&amp;#xA0;million, respectively.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 12px; TEXT-INDENT: 4%; MARGIN-BOTTOM: 0px"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;The total
number of Common Shares issued less the Common Shares held in
treasury is used to determine the Common Shares
outstanding.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"&gt;&lt;font size="1"&gt;&amp;#xA0;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"&gt;&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;&lt;b&gt;Shareholders&amp;#x2019;
Equity&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN-TOP: 6px; TEXT-INDENT: 4%; MARGIN-BOTTOM: 0px"&gt;
&lt;font style="FONT-FAMILY: Times New Roman" size="2"&gt;On
August&amp;#xA0;5, 2009, the Company cancelled the previously approved
share repurchase program and announced a new $500.0 million share
repurchase program which expires on August&amp;#xA0;31, 2012. The
Company expects to use this repurchase program to offset equity
plan issuances. During the three months ended September&amp;#xA0;30,
2009, the Company did not purchase any of its Common Shares under
this program.&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;</NonNumbericText>
          <NonNumericTextHeader>12. EARNINGS PER SHARE
AND SHAREHOLDERS&amp;#x2019; EQUITY

Earnings
per Share

Basic earnings
per Common Share (&amp;#x201C;Basic EPS&amp;#x201D;) is computed by</NonNumericTextHeader>
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
        </Cell>
      </Cells>
      <ElementDefenition>Stockholders Equity and Earnings Per Share</ElementDefenition>
      <ElementReferences>No authoritative reference available.</ElementReferences>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
  </Rows>
  <Footnotes />
  <ComparabilityReport>false</ComparabilityReport>
  <NumberOfCols>1</NumberOfCols>
  <NumberOfRows>2</NumberOfRows>
  <HasScenarios>false</HasScenarios>
  <MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel>
  <SharesRoundingLevel>UnKnown</SharesRoundingLevel>
  <PerShareRoundingLevel>UnKnown</PerShareRoundingLevel>
  <HasPureData>false</HasPureData>
  <SharesShouldBeRounded>true</SharesShouldBeRounded>
</InstanceReport>
