<?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>0001259094</rptOwnerCik>
            <rptOwnerName>ROBERTS BRIAN K</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>0</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>12937</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.00</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>12937</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </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>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Wesley Mintu, as Attorney-in-Fact for Brian K. Roberts</signatureName>
        <signatureDate>2016-09-15</signatureDate>
    </ownerSignature>
</ownershipDocument>
