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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2016-08-22</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, par value $0.01 per share</value>
            </securityTitle>
            <transactionDate>
                <value>2016-08-22</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>P</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>1127338</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>2.95</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>9041883</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnotes</value>
                    <footnoteId id="F1"/>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock, par value $0.01 per share</value>
            </securityTitle>
            <transactionDate>
                <value>2016-08-22</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>P</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>10736</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>2.95</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>86107</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnotes</value>
                    <footnoteId id="F2"/>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Warrants to purchase common stock</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>2.95</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2016-08-22</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>P</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>338201</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.125</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2016-08-22</value>
            </exerciseDate>
            <expirationDate>
                <value>2023-08-22</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>338201</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>338201</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnotes</value>
                    <footnoteId id="F1"/>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
        <derivativeTransaction>
            <securityTitle>
                <value>Warrants to purchase common stock</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>2.95</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2016-08-22</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>P</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>3220</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.125</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2016-08-22</value>
            </exerciseDate>
            <expirationDate>
                <value>2023-08-22</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>3220</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>3220</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnotes</value>
                    <footnoteId id="F2"/>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">These securities are held of record by OrbiMed Private Investments III, LP (&quot;OPI III&quot;) and may be deemed to be indirectly beneficially owned by OrbiMed Capital GP III LLC (&quot;GP III&quot;), OrbiMed Advisors LLC (&quot;Advisors&quot;) and Samuel D. Isaly (&quot;Isaly&quot;). GP III is the sole general partner of OPI III. Advisors, a registered adviser under the Investment Advisers Act of 1940, as amended, is the sole managing member of GP III. By virtue of such relationships, GP III and Advisors may be deemed to have voting and investment power with respect to the securities held by OPI III noted above. The reporting person is an employee of Advisors.</footnote>
        <footnote id="F2">These securities are held of record by OrbiMed Associates III, LP (&quot;Associates III&quot;) and may be deemed to be indirectly beneficially owned by Advisors and Isaly. Advisors is the sole general partner of Associates III. Isaly is the managing member of, and holder of a controlling interest in, Advisors. By virtue of such relationship, Advisors and Isaly may be deemed to have voting and investment power with respect to the securities held by Associates III noted above. As a result, each of Advisors and Isaly may be deemed to have beneficial ownership of the securities held by Associates III.</footnote>
        <footnote id="F3">Each of the Reporting Person, GP III, Advisors, and Isaly disclaims beneficial ownership of the securities reported herein for purposes of Rule 16a-1(a) under the Exchange Act, except to the extent of its or his pecuniary interest therein, if any. This report shall not be deemed an admission that any such entity or person, including the Reporting Person, is a beneficial owner of such securities for the purpose of Section 16 of the Exchange Act, or for any other purpose.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ David P. Bonita</signatureName>
        <signatureDate>2016-08-24</signatureDate>
    </ownerSignature>
</ownershipDocument>
