<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2016-09-13</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0001597313</issuerCik>
        <issuerName>ViewRay, Inc.</issuerName>
        <issuerTradingSymbol>VRAY</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001612312</rptOwnerCik>
            <rptOwnerName>Bilenker Joshua H.</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O AISLING CAPITAL LLC</rptOwnerStreet1>
            <rptOwnerStreet2>888 SEVENTH AVENUE, 12TH FLOOR</rptOwnerStreet2>
            <rptOwnerCity>NEW YORK</rptOwnerCity>
            <rptOwnerState>NY</rptOwnerState>
            <rptOwnerZipCode>10106</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle></officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2016-09-13</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>18964</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.00</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>18964</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>7461923</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F2"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable></derivativeTable>

    <footnotes>
        <footnote id="F1">Restricted Stock Units (&quot;RSUs&quot;). The Reporting Person is entitled to receive one (1) share of Common Stock for each one (1) RSU upon vesting.  100% of the RSUs shall be fully vested as of the date of grant, however, delivery of the shares will be deferred until the earlier of (i) the Reporting Person's termination of service from the Issuer's board of directors or (ii) a Change of Control of the Issuer as defined in the Issuer's 2015 Equity Incentive Award Plan.</footnote>
        <footnote id="F2">Shares are held by Aisling Capital II, LP (&quot;Aisling&quot;). Aisling Capital Partners, LP (&quot;Aisling GP&quot;), is the general partner of Aisling. Aisling Capital Partners LLC (&quot;Aisling Parters&quot;), is the general partner of Aisling GP. The individual managing members (&quot;Aisling Managers&quot;) of Aisling Partners are Dennis Purcell, Andrew Schiff, M.D. and Steve Elms. Dr. Bilenker, a member of the board of directors of ViewRay, Inc., is an Operating Partner of Aisling Capital, LLC, an affiliate of Aisling, however voting and dispositive decisions with respect to shares held by Aisling are not made by Dr. Bilenker. Dr. Bilenker disclaims beneficial ownership of the shares held by Aisling, except to the extent of any pecuniary interest therein, if any.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Wesley Mintu, as Attorney-in-Fact for Joshua H. Bilenker</signatureName>
        <signatureDate>2016-09-15</signatureDate>
    </ownerSignature>
</ownershipDocument>
