<?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>0001572451</rptOwnerCik>
            <rptOwnerName>Bonita David P</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O VIEWRAY, INC.</rptOwnerStreet1>
            <rptOwnerStreet2>2 THERMO FISHER WAY</rptOwnerStreet2>
            <rptOwnerCity>OAKWOOD VILLAGE</rptOwnerCity>
            <rptOwnerState>OH</rptOwnerState>
            <rptOwnerZipCode>44146</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>19531</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.00</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>19531</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>9041883</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F2"/>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>86107</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F3"/>
                    <footnoteId id="F4"/>
                </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">These shares are held of record by OrbiMed Private Investments III, LP (&quot;OPI III&quot;). OrbiMed Capital GP III LLC (&quot;GP III&quot;) is the general partner of OPI III, and OrbiMed Advisors LLC (&quot;Advisors&quot;) is the managing member of GP III. Samuel D. Isaly (&quot;Isaly&quot;), a natural person, is the managing member of and owner of a controlling interest in Advisors. By virtue of such relationships, GP III, Advisors and Isaly may be deemed to have voting and investment power over the securities held by OPI III and as a result may be deemed to have beneficial ownership over such securities. The Reporting Person is an employee of Advisors.</footnote>
        <footnote id="F3">Each of GP III, Advisors, Isaly and the Reporting Person disclaims beneficial ownership of the securities reported herein for purposes of Rule 16a-1(a) under the Securities Exchange Act of 1934, as amended (the &quot;Exchange Act&quot;), except to the extent of its or his pecuniary interest therein, if any. This report on Form 3 shall not be deemed an admission that any such entity or person is a beneficial owner of such securities for the purpose of Section 16 of the Exchange Act, or for any other purpose.</footnote>
        <footnote id="F4">These shares are held of record by OrbiMed Associates III, LP (&quot;Associates III&quot;). Advisors is the general partner of Associates III. Isaly is the managing member of and owner of a controlling interest in Advisors. By virtue of such relationships, Advisors and Isaly may be deemed to have voting and investment power over the securities held by Associates III and as a result may be deemed to have beneficial ownership over such securities.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Wesley Mintu, as Attorney-in-Fact for David P. Bonita</signatureName>
        <signatureDate>2016-09-15</signatureDate>
    </ownerSignature>
</ownershipDocument>
