Exhibit 10.40

STOCK PURCHASE AGREEMENT

This STOCK PURCHASE AGREEMENT (this "Agreement") is made as of August 27, 2007, between Robert Luciano, an
individual ("Seller") and Bally Technologies, Inc., a Nevada corporation ("Bally").

RECITALS

WHEREAS,Seller is an executive officer of Bally and has been unable to dispose of any of his shares of Bally's
common stock, par value $0.10 per share (the "Common Stock"), for an extended period of time because Bally has not been current in its quarterly and
annual filings with the Securities and Exchange Commission.

WHEREAS, Seller has been desirous of selling a portion of his Common Stock in order to gain necessary liquidity.

WHEREAS, Seller desires to sell to Bally a to be determined number of shares (the
"Shares") of Common Stock having an aggregate purchase price equal to Six Million Dollars ($6,000,000) (the "Aggregate Purchase
Price").

WHEREAS, Bally is willing to buy the Shares from Seller for the Aggregate Purchase Price, subject to the terms and conditions of this
Agreement.

WHEREAS, the purchase price for each Share (the "Per Share Purchase Price") will be
determined by calculating the average per share closing price of Bally's common stock on the New York Stock Exchange for the three business days immediately prior to the Closing Date.

WHEREAS, the total number of Shares sold pursuant to this Agreement will be determined by dividing the Aggregate Purchase Price by the Per
Share Purchase Price and rounding down to the nearest whole number.

NOW,THEREFORE, in consideration of the mutual promises and covenants hereinafter set
forth, Bally and Seller hereby agree as follows:

AGREEMENTS

1.Purchase and Sale of Shares.Subject to the terms and conditions of this Agreement, Seller shall hereby sell,
and Bally shall hereby purchase, on the Closing Date (as defined below) the Shares in consideration for the payment of the Aggregate Purchase Price.

2.Purchase Price.The closing of the transaction contemplated herein (the
"Closing") shall take place on October 15, 2007 (the "Closing Date") at 9:00 a.m. Pacific
Time, at the offices of Bally or at such other time or place as the parties may mutually agree in writing. At the Closing, Seller shall transfer the Shares by delivering to Bally certificates
representing the Shares duly endorsed for transfer, and Bally shall pay Seller the Aggregate Purchase Price by check or by wire transfer in immediately available funds to the bank account designated
in the wire transfer instructions attached hereto asExhibit A.

3.Deliveries.



1

---





4.Representations and Warranties of Seller.Seller represents and warrants to Bally as follows:



5.Representations and Covenants of Bally.



2

---





6.Conditions to Closing.The obligation of Bally to consummate the transaction contemplated herein shall be
subject to satisfaction or waiver by Bally of the following conditions:



7.Access to Information; Waiver.



8.Further Assurances.Upon request, Seller agrees to execute and deliver any additional
documents reasonably deemed by Bally to be necessary or desirable to complete the sale of the Shares contemplated hereunder.

9.Governing Law.All terms of and rights under this Agreement shall be governed by and construed in accordance
with the internal law of the State of Nevada, without giving effect to principles of conflicts of law.

10.Notices.All notices and other communications hereunder shall be in writing and shall be deemed given if
delivered personally or by commercial delivery service, or mailed by registered or certified mail (return receipt requested) or sent via facsimile (with acknowledgment of complete transmission) to the
parties at the following addresses (or at such other address for a party as shall be specified by like notice):

(a) If to Bally:

Bally Technologies, Inc.
6601 South Bermuda Road
Las Vegas, Nevada 89119Telecopy:

(702) 584-7990Attention:

Legal Department


3

---



With a copy (which does not constitute notice) to:

Gibson, Dunn & Crutcher LLP
333 South Grand Avenue
Los Angeles, California 90071-3197Telecopy:

(213) 229-7520Attention:

Jeffrey A. Le Sage, Esq.(b) If to Seller:

Robert LucianoWith a copy (which does not constitute notice) to:

Mark Knobel, Esq.
Avansino, Melarkey, Knobel, and Mulligan
4795 Caughlin Parkway, Suite 100
Reno, Nevada 80509


11.Amendments and Waivers.This Agreement may be amended, and any provision hereof may be waived, only by a
writing signed by the party to be charged.

12.Entire Agreement.This Agreement sets forth the entire agreement and understanding between the parties as to
the subject matter hereof and supersedes all prior oral and written and all contemporaneous oral discussions, agreements and understandings with respect to such subject matter.

13.Counterparts.This Agreement may be executed by facsimile signature and in two or more counterparts, each of
which shall constitute an original, but all of which, when taken together, shall constitute but one instrument. This Agreement shall become effective when one or more counterparts have been signed by
each party hereto and delivered to the other parties.

14.Severability.If any provision of this Agreement or the application thereof becomes or is declared by a
court of competent jurisdiction or other governmental entity to be illegal, void or unenforceable, the remainder of this Agreement will continue in full force and effect and the application of such
provision to other persons or circumstances will be interpreted so as reasonably to effect the express intent of the parties hereto. The parties further agree to replace such void or unenforceable
provision of this Agreement with a valid and enforceable provision that will achieve, to the extent possible, the economic, business and other purposes of such void or unenforceable provision.

15.Headings.The article and section headings contained in this Agreement are for reference purposes only and
shall not affect in any way the meaning or interpretation of this Agreement.

16.Successors and Assigns.Except as otherwise provided herein, this Agreement and the rights and obligations
of the parties hereunder shall inure to the benefit of, and be binding upon, the parties' respective successors, assigns and legal representatives.

IN
WITNESS WHEREOF, this Agreement is entered into as of the date first above written.

| |  | SELLER                  
| |  | ------------------------
| |  | By:                     
| |  | BALLY TECHNOLOGIES, INC.
| |  | By:                     
| |  | Its:                    
| |  |                         

4

---



Exhibit B

Assignment Separate From Certificate

FOR VALUE RECEIVED                        hereby sells, assigns
and transfers unto                        
(                        ) shares of Common Stock
of                        , a
                        Corporation, standing in the undersigned's name on the books of said corporation
[represented by Certificate(s) No.            herewith,] and does hereby irrevocably constitute and
appoint                        attorney to transfer the said stock on the books
of the said corporation with full power of substitution in the premises.

Dated:                        ,
2007

|                         |  | Signature |  | 
|------------------------ |  | --------- |  | 
|Signature guaranteed:(1) |  |          
|                         |  |           |  | 

---

---



Exhibit C

Spousal Consent

I hereby consent to the sale of the Shares as provided by that certain Stock Purchase Agreement (the "Agreement")
entered into as of August 27, 2007 by and between Robert Luciano and Bally
Technologies, Inc., and agree that the sale of the Shares as provided for in the Agreement shall apply to my community property interest in such securities, if any.

All
capitalized terms not defined herein shall have the definitions set forth in the Agreement.

|/s/TERESA LUCIANO(Signature of Spouse) |  | 
|-------------------------------------- |  | 
|Print Name: Teresa Luciano             |  | 
|Dated: August 27, 2007.                |  | 

---



Exhibit D

Cross Receipt

CROSS
RECEIPT

Between

Robert
Luciano

and

Bally
Technologies, Inc.

Dated:                        ,
2007

Reference
is made to the Stock Purchase Agreement dated as of                        , 2007 (the "Stock Purchase Agreement") between Robert
Luciano ("Seller") and Bally Technologies, Inc.
("Buyer").

Capitalized
terms used but not defined herein shall have the meanings ascribed to such terms in the Stock Purchase Agreement.



| |  | BALLY TECHNOLOGIES, INC.
| |  | ------------------------
| |  | By:                     
| |  | Its:                    

| |  | By: |  | 
| |  | --- |  | 

---



QuickLinks